how to count cells with equal sign

V

Val29

Hi guys please help me to write this formula:
if the integers of the A1 and A2 are of the same sign(+ or -) =1
if not =0

I need to count cells with equal sign and i don't know how to expres
in formula "equal sign"
Appreciate your help
 
A

AlfD

Hi!

Perhaps use the fact that, if you multiply together two numbers wit
the same sign the answer will be positive. And if you multiply two wit
opposite signs, the answer will be negative.

So: =if(A1*A2>0,1,0).

This doesn't cover the cases of A1 and/or A2 being zero. Does tha
matter? If it does, what "answer" would you want to display?

Al
 
S

SidBord

I'm not clear about the cells with an "=" sign. Usually
when you enter "=" as the first character, Excel insists
you are writing a formula, then trys to evaluate it. The
other case is that you are storing strings of text data
some of which begin with an "=" sign. If the latter is
the case, the use the CountIf function.
Use Left(celladdr,1) to isolate the "=". Sorry I can't be
more detailed, but I can't remember the syntax for
complicated CountIf's.
 
D

Debra Dalgleish

You can use the SIGN function to compare the integers, e.g.:

=IF(SIGN(A1)=SIGN(B1),1,0)

Then SUM the column.

There's information on the SIGN function in Excel's help.
 
Top