SOLVED

Nested IF AND formula for a table of values

Copper Contributor

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!

7 Replies
best response confirmed by NJ_Bruno (Copper Contributor)
Solution

@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:

 

adversi_1-1609353607020.png

 

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

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

 

Much appreciated!

@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)

 

 

 

@Peter Bartholomew 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

@NJ_Bruno 

As variant

=INDEX($B$1:$F$15,MATCH($B$17,$A$1:$A$15,0)+MATCH($B$19,$A$1:$A$15,0)-1,$B$18)

@Sergei Baklan Thank you! I like this because it allows me to keep the table in matrix form.

 

Much appreciated!

Nick

@NJ_Bruno , glad to help. 

1 best response

Accepted Solutions
best response confirmed by NJ_Bruno (Copper Contributor)
Solution

@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:

 

adversi_1-1609353607020.png

 

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

View solution in original post