The Google Sheets IMSUM function returns the sum of a series of complex numbers. Its syntax is IMSUM(value1, [value2, ...]), where each value can be a complex number in the form a+bi or a+bj (entered as text), or a reference to a cell containing such a number.
What Is a Complex Number and Why Use IMSUM?
Complex numbers extend the familiar real numbers by adding an imaginary unit i (or j in engineering), where i² = -1. They appear in electrical engineering (AC circuit analysis), signal processing, quantum physics, and control theory. In Google Sheets, complex numbers are stored as text strings like 3+4i or -2.5-0.5j. The IMSUM function simplifies adding several such numbers without manually separating real and imaginary parts.
How IMSUM Works in Google Sheets
When you call IMSUM, Google Sheets parses each argument as a complex number, sums the real parts together and the imaginary parts together, and returns the result as a complex number in the same format (using i by default). The function accepts up to 255 arguments, each of which can be a literal text string, a cell reference, or a range. If a referenced cell contains a number that is not a valid complex number, IMSUM returns a #NUM! error. If a cell is empty, it is treated as 0.
Example: Suppose cells A1, A2, and A3 contain 1+2i, 3-4i, and -2+1i. The formula =IMSUM(A1:A3) returns 2-1i because (1+3-2)=2 and (2-4+1)=-1.
IMSUM Syntax and Argument Details
- value1 (required): The first complex number or range.
- value2, … (optional): Additional complex numbers or ranges, up to 255 total arguments.
Each value must be a text string in a recognized complex number format: a, a+bi, a-bi, bi, etc. Both i and j are accepted as the imaginary unit. The function ignores any text that is not a valid complex number? Actually, it returns an error if an argument is invalid. If you need to sum a range that includes non-complex numbers, filter them out first.
Common Problems and Errors with IMSUM
Users often encounter the #NUM! error when a cell contains a real number without an imaginary part (e.g., 5 instead of 5+0i). To fix this, convert it to a complex number using the COMPLEX function: =COMPLEX(5,0). Another issue is mixing formats: if one cell uses j and another uses i, the result always uses i, which may confuse some. Also, IMSUM does not accept arrays that contain blank cells? Actually it does, treating blanks as 0. However, if a cell contains text like 3+4x, it will error. Always ensure your data is clean.
IMSUM vs. SUM: When to Use Which
The regular SUM function adds real numbers and ignores text, but it cannot handle complex numbers. If you try =SUM("1+2i", "3+4i"), it returns 0 because text is ignored. IMSUM is specifically designed for complex numbers. Use SUM for ordinary real-number arithmetic and IMSUM whenever any of the numbers has an imaginary component. If you only have real numbers, SUM is simpler and faster.
Practical Examples of IMSUM
Here are a few scenarios where IMSUM proves useful:
- AC circuit analysis: Sum impedances in series:
=IMSUM("10+5j", "20-3j")returns30+2j. - Adding multiple complex numbers from a range: With B2:B10 containing complex numbers,
=IMSUM(B2:B10)gives the total. - Combining with other engineering functions: Use
IMPRODUCTto multiply and thenIMSUMto add results.
Frequently Asked Questions
Can I use IMSUM with a range that contains blank cells?
Yes, blank cells are treated as 0, so they do not affect the sum. But if a cell contains any text that is not a valid complex number, the function returns an error.
Does IMSUM work with the imaginary unit ‘j’ as well as ‘i’?
Yes, both are accepted. The output always uses ‘i’, regardless of the input format.
How do I convert a real number to a complex number for IMSUM?
Use the COMPLEX function: =COMPLEX(real_part, imaginary_part). For example, =COMPLEX(5,0) returns 5+0i.
What happens if I sum complex numbers with different formats, like ‘1+2i’ and ‘3-4j’?
IMSUM parses both correctly and returns the sum using ‘i’. The result would be ‘4-2i’ in this case.
Is IMSUM available in Excel?
Yes, Excel has an IMSUM function with the same syntax, but it is part of the Analysis ToolPak add-in in older versions. In Excel 365, it is built-in. The behavior is identical.
Can I use IMSUM with a cell that contains a formula returning a complex number?
Yes, as long as the formula returns a valid complex number text string, IMSUM will accept it. For example, =IMSUM(IMPRODUCT("1+i","2-i"), "3+2i") works.
Alternatives and Related Functions
If you need to subtract complex numbers, use IMSUB. For multiplication, IMPRODUCT; for division, IMDIV. To get the real part of a complex number, use IMREAL; for the imaginary part, IMAGINARY. If you are working with arrays of complex numbers and need element-wise operations, consider using ARRAYFORMULA with these functions. For simple real-number sums, stick with SUM.
Related
- Google Sheets SUMIF Between Dates: Formula & Examples
- Data Entry Part Time Jobs From Home
- Sample Balance Sheet and P&L: What They Look Like
Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.
More in How-to basics
- Excel and Numbers Compatibility: What WorksExcel and Apple Numbers are compatible for basic data exchange, but not fully: Numbers can open Excel files…
- How to Schedule an Email in Outlook on Any DeviceTo schedule an email in Outlook, write your message, open the menu beside Send, choose Schedule send, and…
- Google Sheets: Is It a Microsoft App?No. Google Sheets is a spreadsheet application made by Google, not Microsoft. Microsoft’s comparable spreadsheet program is Excel;…
- Insert Image in Excel Cell Without Resizing Rows or ColumnsIn Excel for Microsoft 365 on Windows, use Insert > Pictures > Place in Cell to put an…
- Java String split -1? Meaning and How to Use ItIn Java, String.split(String regex, int limit) with a limit of -1 means the pattern is applied as many…
- Excel Columns Keep Collapsing? Causes and FixesIf Excel columns keep collapsing, they are usually hidden or grouped into an outline—not deleted. On Windows, select…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.