Forum Discussion
bengal1022
May 27, 2019Copper Contributor
Help with a Formula - Might be IF
I am looking for a formula to do the following. I believe it is an "IF", but not sure. I basically want a formula to return results based on the following: If the cell with the number is <=...
- May 27, 2019
Hi,
You need to IF along with AND to do this as follows.
=IF(A1<=50,A1*2,
IF(AND(A1>50,A1<=100),A1*1.75,
IF(AND(A1>100,A1<=200),A1*1.5,"N/A")))Hope that helps
Haytham Amairah
May 27, 2019Silver Contributor
Hi,
You need to IF along with AND to do this as follows.
=IF(A1<=50,A1*2,
IF(AND(A1>50,A1<=100),A1*1.75,
IF(AND(A1>100,A1<=200),A1*1.5,"N/A")))
Hope that helps
- bengal1022May 28, 2019Copper ContributorThis worked.
Thank You! - PeterBartholomew1May 27, 2019Silver Contributor
This is not challenging the correctness of your solution, merely that it can be simplified by taking into account that the inner tests needn't confirm that the outer test has given false; if it hadn't, the inner test would not be executed.
=IF( A1<=50, A1*2, IF(A1<=100, A1*1.75, IF(A1<=200, A1*1.5,"N/A")))
Another possibility if an up to date version of Excel is being used is the IFS function
= IFS( A1<=50, 2, A1<=100, 1.75, A1<=200, 1.5, 1, NA() ) * A1