Alternatives for Nested IF(and( function. I reached the maximum 7

newbieexceldude

New Member
Joined
Jan 24, 2014
Messages
3
Hello there

I am very new to this forum, but already have found a lot of great help. Thanks!

However, I have a new problem. I am using the "=if(and(" function, but Excel is rejecting more than 7 functions. I will need at least 20. Is there a way around this?

The data I am working on is as follows:
CertainLikelySomewhatUnlikely
ReoccurringGreenGreenBlueBlue
IntermittentRedPurpleRedRed
InfrequentYellowPinkGreenGreen

<tbody>
</tbody>

The formula i've used is: =IF(AND(L4="Certain",N4="Reoccurring"),"Green (1)", IF(AND(L4="Certain",N4="Intermittent"),"Red (2)", IF(AND(L4="Certain",N4="Infrequent"),"Yellow (4)"

Do you have any suggestions?

Thank you very much.
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Is this what you are trying to do?
Excel Workbook
ABCDEFGHIJKLMNO
1CertainLikelySomewhatUnlikely
2ReoccurringGreenGreenBlueBlueRed
3IntermittentRedPurpleRedRed
4InfrequentYellowPinkGreenGreenCertainIntermittent
5
Sheet
 
Upvote 0
Hello there:

Thank you very much for your prompt feedback!! This formula would surely work, but I think I didn't explain correctly what I am doing. The table that I showed in my question was just to show the logical arguments that need to go into the formula. My Excel sheet does not have this table.

What I have is the following:

Condition 1 Condition 2 Result
CertainReoccurringGreen
LikelyInfrequentPink

<tbody>
</tbody>

I have a sheet with about 2,500 rows where I could have any combination of the conditions in the first table above. What I have done is use the IF(AND function so the correct value is entered in the Result cell. However, Excel only allows a maximum of 7 functions to be nested. So I wonder if there is another function I could use. I tried CONCATENATE but it didn't work.

Any ideas?

My best regards

Is this what you are trying to do?

*ABCDEFGHIJKLMNO
1*CertainLikelySomewhatUnlikely**********
2ReoccurringGreenGreenBlueBlue******Red***
3IntermittentRedPurpleRedRed**********
4InfrequentYellowPinkGreenGreen******Certain*Intermittent*
5***************

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:97px;"><col style="width:93px;"><col style="width:64px;"><col style="width:78px;"><col style="width:86px;"><col style="width:20px;"><col style="width:21px;"><col style="width:25px;"><col style="width:20px;"><col style="width:22px;"><col style="width:18px;"><col style="width:64px;"><col style="width:34px;"><col style="width:84px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
L2=INDEX($B$2:$E$4,MATCH($N$4,$A$2:$A$4,0),MATCH($L$4,$B$1:$E$1,0))

<tbody>
</tbody>

<tbody>
</tbody>



Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
Maybe something like below.

You could put a table into the workbook, which would make it easy to make changes if needed or if you can't add a table then build the table into the formula (as in F12 below).
Excel Workbook
ABCDEFG
1TABLEWith Table
2CertainReoccurringGreenCertainReoccurringGreen
3CertainIntermittentRedLikelyInfrequentPink
4CertainInfrequentYellow
5LikelyReoccurringGreen
6LikelyIntermittentPurpleWithout Table
7LikelyInfrequentPinkCertainReoccurringGreen
8SomewhatReoccurringBlueLikelyInfrequentPink
9SomewhatIntermittentRed
10SomewhatInfrequentGreen
11UnlikelyReoccurringBlue
12UnlikelyIntermittentRed
13UnlikelyInfrequentGreen
14
Sheet
 
Upvote 0
PERFECT!!! Adding the table to the formula did the trick!!

Thank you very much!!!!

Maybe something like below.

You could put a table into the workbook, which would make it easy to make changes if needed or if you can't add a table then build the table into the formula (as in F12 below).

*ABCDEFG
1TABLE**With Table***
2CertainReoccurringGreen*CertainReoccurringGreen*
3CertainIntermittentRed*LikelyInfrequentPink*
4CertainInfrequentYellow*****
5LikelyReoccurringGreen*****
6LikelyIntermittentPurple*Without Table***
7LikelyInfrequentPink*CertainReoccurringGreen*
8SomewhatReoccurringBlue*LikelyInfrequentPink*
9SomewhatIntermittentRed*****
10SomewhatInfrequentGreen*****
11UnlikelyReoccurringBlue*****
12UnlikelyIntermittentRed*****
13UnlikelyInfrequentGreen*****
14*******

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:164px;"><col style="width:64px;"><col style="width:64px;"><col style="width:111px;"><col style="width:107px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
F2=VLOOKUP(D2&E2,A2:B13,2,0)
F3=VLOOKUP(D3&E3,A3:B14,2,0)
F7=VLOOKUP(D7&E7,{"CertainReoccurring","Green";"CertainIntermittent","Red";"CertainInfrequent","Yellow";"LikelyReoccurring","Green";"LikelyIntermittent","Purple";"LikelyInfrequent","Pink";"SomewhatReoccurring","Blue";"SomewhatIntermittent","Red";"SomewhatInfrequent","Green";"UnlikelyReoccurring","Blue";"UnlikelyIntermittent","Red";"UnlikelyInfrequent","Green"},2,0)
F8=VLOOKUP(D8&E8,{"CertainReoccurring","Green";"CertainIntermittent","Red";"CertainInfrequent","Yellow";"LikelyReoccurring","Green";"LikelyIntermittent","Purple";"LikelyInfrequent","Pink";"SomewhatReoccurring","Blue";"SomewhatIntermittent","Red";"SomewhatInfrequent","Green";"UnlikelyReoccurring","Blue";"UnlikelyIntermittent","Red";"UnlikelyInfrequent","Green"},2,0)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
You're welcome. Glad that worked for you. The only downside is it's a little harder to make changes if the table is hard coded into the formula.
Thanks for the feedback and welcome to the forum.
 
Upvote 0

Forum statistics

Threads
1,216,075
Messages
6,128,665
Members
449,462
Latest member
Chislobog

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