Forum Discussion
mjosetectaamericacom
Feb 21, 2023Copper Contributor
IF Function Question
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
- Feb 27, 2023This 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)
HansVogelaar
Feb 21, 2023MVP
Perhaps
=IFS(C4<25, 3.25, C4<50, 2.5, next condition, next return value, ...)
Or use a lookup function:
mjosetectaamericacom
Feb 27, 2023Copper Contributor
HansVogelaar 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?
- HansVogelaarFeb 27, 2023MVP
It should work:
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?
- mjosetectaamericacomFeb 27, 2023Copper Contributor
- HansVogelaarFeb 27, 2023MVP
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)