SOLVED

IF Function Question

Copper Contributor

How do I combine a string of IF AND/OR commands?

Example: =IF(AND(C4<25, 3.25)), IF(AND(C4>25,C4<50, 2.5))

I need to continue the command for 6 more 

6 Replies

@mjosetectaamericacom 

Perhaps

 

=IFS(C4<25, 3.25, C4<50, 2.5, next condition, next return value, ...)

 

Or use a lookup function:

 

HansVogelaar_0-1677018180877.png

@Hans Vogelaar Thank you for your help.  This worked for me, with the exception of the last condition that I needed to be greater than 3000. When I tried C12>3000, 1.3, it would give me a N/A error.  To eliminate the error, I had to change the 3000 to 1.  Then my calculation worked.  Can you help me with an explanation?

@mjosetectaamericacom 

It should work:

S2300.png

Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?

@mjosetectaamericacom 

How about

 

You should use either C11>=3000 here, or simply TRUE:

 

=IFS(C11<25, 3.25, C11<50, 2.5, C11<75, 2.25, C11<500, 1.9, C11<1000, 1.55, C11<2000, 1.45, C11<3000, 1.35, C11>=3000, 1.25)

 

or

 

=IFS(C11<25, 3.25, C11<50, 2.5, C11<75, 2.25, C11<500, 1.9, C11<1000, 1.55, C11<2000, 1.45, C11<3000, 1.35, TRUE, 1.25)

best response confirmed by mjosetectaamericacom (Copper Contributor)
Solution
This one works:
=IFS(C11<25, 3.25, C11<50, 2.5, C11<75, 2.25, C11<500, 1.9, C11<1000, 1.55, C11<2000, 1.45, C11<3000, 1.35, C11>=3000, 1.25)
1 best response

Accepted Solutions
best response confirmed by mjosetectaamericacom (Copper Contributor)
Solution
This one works:
=IFS(C11<25, 3.25, C11<50, 2.5, C11<75, 2.25, C11<500, 1.9, C11<1000, 1.55, C11<2000, 1.45, C11<3000, 1.35, C11>=3000, 1.25)

View solution in original post