The IMREAL function in Google Sheets returns the real coefficient of a complex number. For example, =IMREAL("3+4i") returns 3. It is part of the Engineering category and is useful for anyone working with complex numbers in electrical engineering, physics, or advanced mathematics.
What Is a Complex Number?
A complex number combines a real part and an imaginary part, written in the form a + bi, where a is the real coefficient, b is the imaginary coefficient, and i is the imaginary unit (the square root of -1). In Google Sheets, complex numbers are stored as text strings like "3+4i" or "-2.5-0.5j". The IMREAL function extracts the a part, ignoring the imaginary component.
IMREAL Syntax and Arguments
The syntax is simple: IMREAL(complex_number). The only argument is complex_number, which can be:
- A text string in quotes, like
"5+2i" - A reference to a cell containing a complex number as text, like
A1 - The result of another complex-number function, like
IMSUMorIMPRODUCT
The function accepts both i and j as the imaginary unit, matching common engineering notation. If the input is not a valid complex number, IMREAL returns a #NUM! error.
How to Use IMREAL in Google Sheets
Using IMREAL is straightforward. Follow these steps:
- Click a cell where you want the result, e.g.,
B2. - Type
=IMREAL(. - Enter a complex number in quotes or click a cell that contains one, e.g.,
"6-8i"orA2. - Press Enter. The real part appears.
For example, if cell A1 contains "4+5i", then =IMREAL(A1) returns 4. If you use =IMREAL("3-2j"), it returns 3.
Practical Examples with IMREAL
Here are a few concrete examples you can try in your spreadsheet:
=IMREAL("7+3i")→7=IMREAL("-2.5+0i")→-2.5(the imaginary part is zero)=IMREAL("0-4i")→0(pure imaginary number)=IMREAL(IMSUM("1+2i","3-4i"))→4(first adds the complex numbers: 1+2i + 3-4i = 4-2i, then extracts 4)
You can also combine IMREAL with IMAGINARY (which returns the imaginary coefficient) to break a complex number into its components. For instance, with "5-3i", IMREAL gives 5 and IMAGINARY gives -3.
Common Errors and Troubleshooting
If IMREAL returns an error, here are the likely causes:
- #NUM!: The argument is not a valid complex number. Check for missing quotes, extra spaces, or an incorrect format like
"3+4"(missingi). - #VALUE!: The argument is a number, not text. Complex numbers must be entered as text strings or cell references to text.
- #N/A: The cell reference is empty or invalid.
Remember that Google Sheets treats complex numbers as text. If you enter 3+4i without quotes, Sheets may interpret it as a formula and throw an error. Always use quotes or a cell reference.
IMREAL vs. Related Functions
Google Sheets offers a full set of complex-number functions. IMREAL pairs with IMAGINARY to split a complex number. Other related functions include:
IMSUM– adds complex numbersIMPRODUCT– multiplies complex numbersIMCONJUGATE– returns the complex conjugateIMABS– returns the magnitude (modulus)IMARGUMENT– returns the angle (argument) in radians
While IMREAL extracts the real part, IMAGINARY extracts the imaginary coefficient. For example, =IMAGINARY("3+4i") returns 4. These two functions are often used together when analyzing AC circuits or signal processing data.
Frequently Asked Questions
Can IMREAL handle complex numbers with ‘j’ instead of ‘i’?
Yes. Google Sheets accepts both i and j as the imaginary unit. For example, =IMREAL("2+3j") returns 2. This is handy for engineers who use j to avoid confusion with current.
What happens if I use a cell with a real number, like 5?
If the cell contains the number 5 (not text), IMREAL will return a #VALUE! error because it expects a complex number in text format. You can convert it by using =IMREAL("5+0i") or by formatting the cell as text and entering 5+0i.
Does IMREAL work with complex numbers in exponential form?
No. IMREAL only accepts the standard rectangular form a+bi. If you have a number in polar form, like 5∠30°, you must convert it to rectangular form first using trigonometric functions or the COMPLEX function.
Can I use IMREAL in array formulas?
Yes, you can use IMREAL with ARRAYFORMULA to process a range of complex numbers. For example, if A1:A3 contains "1+2i", "3-4i", "5+6i", then =ARRAYFORMULA(IMREAL(A1:A3)) returns {1; 3; 5}.
Is IMREAL available in Excel?
Yes, Excel has an IMREAL function with the same syntax and behavior. However, the way complex numbers are entered and displayed may differ slightly in formatting. The function works identically in both applications.
Why does IMREAL return 0 for a purely imaginary number?
Because the real coefficient of a number like 0+4i is zero. That is mathematically correct. If you need to check whether a number is purely imaginary, you can use =IMREAL(A1)=0.
Related
- Balance Sheet of the United States: Full Breakdown
- Google Sheets ERF Function: Syntax & Examples
- Google Sheets Sum Checkbox: 3 Ways to Count Checked
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- How to Clear Cache Files in Outlook SafelyTo clear Outlook’s local cache on Windows, close classic Outlook, rename the account’s .ost file, then reopen Outlook…
- Grocery List Excel Template: Free Options and SetupYes—you can get a free grocery list Excel template or make one yourself in a blank workbook. In…
- Can You Password Protect an Excel Spreadsheet?Yes. In Excel for Microsoft 365 on Windows, you can require a password to open a workbook by…
- Freeze One Row and One Column in Excel at the Same TimeTo freeze the top row and first column together in Excel for Microsoft 365 on Windows, select cell…
- Binary Excel Solver: How to Build and Solve 0-or-1 ModelsYes. In Excel for Microsoft 365 on Windows, use the Solver add-in and set the decision-cell range’s constraint…
- Excel Data Validation List Without a Cell Reference?Yes. In Excel for Microsoft 365 on Windows, select the cells, choose Data > Data Validation, set Allow…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.