Nesting Limit Hit Using IF and AND functions

HomeTek

New Member
Joined
Jan 27, 2017
Messages
42
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Using Excel 2007

I have Googled and Googled and tried to use various examples to help me with this but to no avail.

I know nesting isn't ideal, but I need to possibly nest around 10 statements. However I have hit the limit of 7 and can no longer add any more conditions.

Below is an example of the formula I have been using.

=IF(AND(B16="Yes",B19="No",B22="No",B25="Yes"),"Result 1",IF(AND(B16="Yes",B19="No",B22="No",B25="No"),"Result 2",IF(AND(B16="Yes",B19="No",B22="",B25="Yes"),"Result 3",IF(AND(B16="Yes",B19="No",B22="",B25="No"),"Result 4",IF(AND(B16="Yes",B19="No",B22="Yes",B25="No"),"Result 5",IF(AND(B16="Yes",B19="Yes",B22="No",B25="Yes"),"Result 6",IF(AND(B16="Yes",B19="Yes",B22="No",B25="No"),"Result 7","")))))))

If I was using a later Excel I would have no problems as the limit is higher and I only need around 10 or so nesting levels. But unfortunately I am using Excel 2007 and have hit the limit.

Does anyone know how I could amend the formula above at all to get around this problem or maybe I need to totally scrap it and look at it from a different angle?

Many thanks
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
A lookup table in A1:B10?

[TABLE="width: 235"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Yes|No|No|Yes[/TD]
[TD]Result 1[/TD]
[/TR]
[TR]
[TD]Yes|No|No|No[/TD]
[TD]Result 2[/TD]
[/TR]
[TR]
[TD]Yes|No||Yes[/TD]
[TD]Result 3[/TD]
[/TR]
[TR]
[TD]Yes|No||No[/TD]
[TD]Result 4[/TD]
[/TR]
[TR]
[TD]Yes|No|Yes|No[/TD]
[TD]Result 5[/TD]
[/TR]
[TR]
[TD]Yes|Yes|No|Yes[/TD]
[TD]Result 6[/TD]
[/TR]
[TR]
[TD]Yes|Yes|No|No[/TD]
[TD]Result 7[/TD]
[/TR]
</tbody>[/TABLE]

Then a vlookup:

=IFERROR(VLOOKUP(B16&"|"&B19&"|"&B22&"|"&B25,$A$1:$B$10,2,0),"")
 
Upvote 0
Brilliant. It works perfectly.

I did try to use a Vlookup originally, but I had no idea you could do a Vlookup using multiple cells like that until now.

Much appreciated.
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top