SOLVED

New Contributor

# 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!

7 Replies
Best Response confirmed by NJ_Bruno (New Contributor)
Solution

# Re: Nested IF AND formula for a table of values

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

# Re: Nested IF AND formula for a table of values

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

Much appreciated!

# Re: Nested IF AND formula for a table of values

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

# Re: Nested IF AND formula for a table of values

@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

# Re: Nested IF AND formula for a table of values

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

# Re: Nested IF AND formula for a table of values

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

Much appreciated!

Nick

# Re: Nested IF AND formula for a table of values

@NJ_Bruno , glad to help.