Nesting Limit Hit Using IF and AND functions

HomeTek

New Member
Joined
Jan 27, 2017
Messages
32
Office Version
365
Platform
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
 

steve the fish

Well-known Member
Joined
Oct 20, 2009
Messages
7,793
Office Version
365
Platform
Windows
A lookup table in A1:B10?

Yes|No|No|YesResult 1
Yes|No|No|NoResult 2
Yes|No||YesResult 3
Yes|No||NoResult 4
Yes|No|Yes|NoResult 5
Yes|Yes|No|YesResult 6
Yes|Yes|No|NoResult 7

<colgroup><col><col></colgroup><tbody>
</tbody>

Then a vlookup:

=IFERROR(VLOOKUP(B16&"|"&B19&"|"&B22&"|"&B25,$A$1:$B$10,2,0),"")
 

HomeTek

New Member
Joined
Jan 27, 2017
Messages
32
Office Version
365
Platform
Windows
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.
 

Forum statistics

Threads
1,082,295
Messages
5,364,359
Members
400,792
Latest member
Dxmiian

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top