Forum Discussion

NJ_Bruno's avatar
NJ_Bruno
Copper Contributor
Dec 30, 2020
Solved

Nested IF AND formula for a table of values

Hi Community!

 

I need help on a nested IF AND formula. I have the first part correct with =IF(AND(B17=A1,B18=D2,B19="Monthly"),B3) where I have a separate table with values in A1, B2 & B3. I have several more values in the table in different cells.

 

What I want to do is combine several IF AND formulas into one cell so that when I change the values of cells B17, B18 & B19, the cell with the formula (D19) displays an answer from the table. If there is a better way to set this up than using nested IF AND, then please advise.

 

Thanks and Happy New Year!

  • NJ_Bruno 

    To make your NESTED IF statement less complicated and more dynamic, it is best to unpivot your data and maintain one single table reference (as long as the same parameters/information are shared). Here's an example of what I mean:

     

     

    With this new setup, your complex NESTED IF statement is no longer needed and a simple SUMIFS statement can be used to return the right Fee figure you're looking for

7 Replies

  • NJ_Bruno 

    Normalising the data into a table has a lot to commend it, but it is possible to work directly with data presented as arrays.

     

     

    = LET(
      FeeTable, IF(Binsize=35, Size35fees, Size64fees),
      Freq, XMATCH(Frequency, FrequencyOptions),
      Fee, INDEX(FeeTable, Freq, Quantity),
      Fee)

     

     

    or, in older versions of Excel

     

     

    = INDEX( 
        IF(Binsize=35, Size35fees, Size64fees), 
        MATCH(Frequency, FrequencyOptions, 0), 
        Quantity)

     

     

     

    • NJ_Bruno's avatar
      NJ_Bruno
      Copper Contributor

      PeterBartholomew1 Thanks, Peter. I like the drop down menu feature. I'll play around with both and come up with something that works well for our purposes.

       

      Much appreciated and have a great New Year.

       

      -Nick

  • adversi's avatar
    adversi
    Iron Contributor

    NJ_Bruno 

    To make your NESTED IF statement less complicated and more dynamic, it is best to unpivot your data and maintain one single table reference (as long as the same parameters/information are shared). Here's an example of what I mean:

     

     

    With this new setup, your complex NESTED IF statement is no longer needed and a simple SUMIFS statement can be used to return the right Fee figure you're looking for

    • NJ_Bruno's avatar
      NJ_Bruno
      Copper Contributor

      adversi Excellent! Thank you so much. I'll work with this and post again if I have any problems. 

       

      Much appreciated!

Resources