Imaginary Numbers conditional.xlsmHello,

I have a list of numbers, some of which are ordinary real numbers (e.g. 6), some of which have an imaginary component (e.g. 0+2i or 0-3i).

1) I'm trying to count the number of cells in the list that have a positive imaginary component, and how many have a negative imaginary component. The following works but is inelegant and does not help with item (2).

=COUNTIF(C10:C20,"*i") for counting cells with positive imaginary numbers,

=COUNTIF(C10:C20, "*-*i") for cells with negative imaginary numbers.

2) Similarly, I'd like to do a conditional sum of the magnitudes of the negative OR positive imaginary values. E.g. if the list of numbers is

6

5

3i

2i

-5i

-6i

Then I'd like to find that all the positive imaginary numbers add up to 5, while the negative imaginary numbers add up to 11. I need to do this without creating a new column (e.g. it is possible to create a column with formula =IMAGINARY(), then use the resulting ordinary numbers in a simple COUNTIF or SUMIF function, but I cant have a new column).

Thank you.

I have a list of numbers, some of which are ordinary real numbers (e.g. 6), some of which have an imaginary component (e.g. 0+2i or 0-3i).

1) I'm trying to count the number of cells in the list that have a positive imaginary component, and how many have a negative imaginary component. The following works but is inelegant and does not help with item (2).

=COUNTIF(C10:C20,"*i") for counting cells with positive imaginary numbers,

=COUNTIF(C10:C20, "*-*i") for cells with negative imaginary numbers.

2) Similarly, I'd like to do a conditional sum of the magnitudes of the negative OR positive imaginary values. E.g. if the list of numbers is

6

5

3i

2i

-5i

-6i

Then I'd like to find that all the positive imaginary numbers add up to 5, while the negative imaginary numbers add up to 11. I need to do this without creating a new column (e.g. it is possible to create a column with formula =IMAGINARY(), then use the resulting ordinary numbers in a simple COUNTIF or SUMIF function, but I cant have a new column).

Thank you.

## Comment