IF NOT Statement

  • Thread starter rtwiss via OfficeKB.com
  • Start date
R

rtwiss via OfficeKB.com

What am I do wrong here?

=IF(NOT(ISNUMBER(J12),ISNUMBER(K12)),"boy","girl")
 
R

Rick Rothstein

What am I do wrong here?
=IF(NOT(ISNUMBER(J12),ISNUMBER(K12)),"boy","girl")

Depends on what the formula is supposed to be doing. Can you tell us in
words what you expected the formula to do?
 
R

rtwiss via OfficeKB.com

Rick said:
Depends on what the formula is supposed to be doing. Can you tell us in
words what you expected the formula to do?
if J12 and K12 are not numbers then boy (True statement), girl (False
statement)
 
R

Rick Rothstein

Actually, for what you have described, I think this will do what you want
also...

=IF(COUNT(J12:K12)=0,"boy","girl")

--
Rick (MVP - Excel)


Rick Rothstein said:
Try this...

=IF(AND(NOT(ISNUMBER(J12)),NOT(ISNUMBER(K12))),"boy","girl")
 
R

Rick Rothstein

I don't think that does what the OP asked for. Both cells must contain
non-numbers for it to be "boy"... your formula returns "boy" if one is a
number and one is not a number... I'm pretty sure the OP want "girl"
returned for that condition.
 
K

klswvu

=IF((AND(NOT(ISNUMBER(J12)),NOT(ISNUMBER(K12)))),"Boy","Girl")

Logic Results
J12 K12 Results
1 2 Girl
1 A Girl
A 1 Girl
A A Boy
 
D

David Biddulph

Excel tells you that there are too many arguments for the function. NOT
takes one argument, not two.

What you are trying to achieve is a different question.
 
G

Glenn

Rick said:
I don't think that does what the OP asked for. Both cells must contain
non-numbers for it to be "boy"... your formula returns "boy" if one is a
number and one is not a number... I'm pretty sure the OP want "girl"
returned for that condition.

You are probably right...

"if J12 and K12 are not numbers then boy (True statement), girl (False
statement)"

What if J12 is a number and K12 is not?
 
R

rtwiss via OfficeKB.com

then false
You are probably right...

"if J12 and K12 are not numbers then boy (True statement), girl (False
statement)"

What if J12 is a number and K12 is not?
 

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

Top