Forum Discussion

bengal1022's avatar
bengal1022
Copper Contributor
May 27, 2019
Solved

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 <=50, then multiply by 2

If the cell with the number is >50, but <=100, then multiply by 1.75

If the cell with the number is >100, but <=200, then multiply by 1.50

 

I am trying to combine in one formula so that I can copy it all the way down the spreadsheet. Any help would be greatly appreciated.

 

 

  • 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

     

    bengal1022 

3 Replies

  • Haytham Amairah's avatar
    Haytham Amairah
    Silver 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

     

    bengal1022 

    • PeterBartholomew1's avatar
      PeterBartholomew1
      Silver Contributor

      Haytham Amairah 

      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