how to count cells with equal sign

  • Thread starter Thread starter Val29
  • Start date Start date
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
 
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
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top