Have too many ifs for one formula

BrianKebic

New Member
Joined
Mar 15, 2019
Messages
2
Have too many ifs in my formula. If I trying using IFS the formula doesn't work. Tried usings IFS, and several other combinations but to no avail. Maybe I'm trying to do too much for cell?

=
IF(F8="","",AND(D8<10,M8<=M6+2),M6,AND(D8<10,M8>M6+2),M6+2,AND(D8>9<20,M8<=7),M6,AND(D8>9<20,M8>7),7,AND(D8>19<30,M8<8),M8,AND(D8>19<30,M8>8),8,AND(D8>29<40,M8<=9),M8,AND(D8>29<40,M8>9,9)

So basically in cell M10
if D8<10 & M8<=M6+2 are true then M6
if D8<10 & M8>M6+2 are true then M6+2
if D8>9<20 & M8<=7 are true then M6
if D8>9<20 & M8>7 are true then 7
if D8>19<30 & M8<=8 are true then M6
if D8>19<30 & M8>8 are true then 8
if D8>29<40 & M8<=9 are true then M6
if D8>29<40 & M8>9 are true then 9

Any thoughts?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
HTH - tks for the response. Still having problems but I suspect its the "AND" function that I'm not using right. Back to the basics to see if I can put this together somehow.
 
Upvote 0
Hi Brian. Your formula is all wrong. The formula should be written as =IF(F8="","",if(AND(D8<10,M8<=M6+2),M6,If(… The syntax is If(a then b if not then if(c then d if not then d)). This won't fix your formula as you can only nest 7 ifs. The solution is to break your formula into two parts and combine the results with a "+" and with each part having less than 7 nested ifs.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,139
Members
453,021
Latest member
Justyna P

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