[newbie] if statement

J

Jon

I'm trying to include a conditional however, I'm getting a sort of a syntax
error:

=if((F5>H5) AND (UPPER(C7) = "YES") AND (C9/C10 > H9), "Yes", "No")

F5> 0.80
H5> 0.75
C7 > Yes
C9 > 50000
C10 > 45000 C9/C10 = 1.11.
H9 > 0.90

Any ideas?
 
J

Joe User

Jon said:
I'm trying to include a conditional however, I'm getting
a sort of a syntax error:
=if((F5>H5) AND (UPPER(C7) = "YES") AND (C9/C10 > H9), "Yes", "No")

=if(and(F5>H4, UPPER(C7)="YES", C9/C10 > H9), "Yes", "No")

If C10 can be zero, you will want to do this differently, perhaps:

=if(C10=0, "No", if(and(F5>H4, UPPER(C7)="YES", C9/C10 > H9), "Yes", "No"))

or

=if(C10=0, if(and(F5>H4, UPPER(C7)="YES"), "Yes", "No"),
if(and(F5>H4, UPPER(C7)="YES", C9/C10 > H9), "Yes", "No"))


----- original message -----
 
D

Dave

Hi,
The syntax for AND is:
AND(Condition1, Condition 2, Condition n)
Try this syntax:
=IF(AND(F5>H5, UPPER(C7)="YES", C9/C10>H9),"Yes","No")

Note that if C10 is blank, you'll get a #DIV/0! (divide by zero) error.

Regards - Dave.
 
T

Teethless mama

=if(and(F5>H4, UPPER(C7)="YES", C9/C10 > H9), "Yes", "No")

Remove the "UPPER" part. It's not a case senstive
C7="Yes", or C7="YES", or C7="yEs"
 
M

MyVeryOwnSelf

I'm trying to include a conditional however, I'm getting a sort of a
syntax error:

=if((F5>H5) AND (UPPER(C7) = "YES") AND (C9/C10 > H9), "Yes", "No")

The way to do logical AND in Excel is
AND(condition1, condition2, condition3)

So maybe this will meet the need:
=IF(AND(F5>H5, UPPER(C7)="YES", C9/C10>H9), "Yes", "No")

Or with an error check:
=IF(C10=0, "undefined", IF(...as above...))
 

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