Formula is not producing a result

raysha22

New Member
Joined
Nov 28, 2017
Messages
16
I have the following formula that is not returning a value.


=IFERROR(IF(AND(D79>1,(WEEKDAY(D79)=2)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D79+2),0),))),IF(AND(D79>1,(WEEKDAY(D79)=3)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D79+6),0),))),IF(AND(D79>1,(WEEKDAY(D79)=4)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D79+5),0),))),IF(AND(D79>1,(WEEKDAY(D79)=5)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D79+4),0),))),IF(AND(D79>1,(WEEKDAY(D79)=6)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D79+5),0),))),IF(AND(D79=””,(WEEKDAY(D78)=2)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D78+2),0),))),IF(AND(D79=””,(WEEKDAY(D78)=3)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D78+6),0),))),IF(AND(D79="",(WEEKDAY(D78)=4)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D78+5),0),))),IF(AND(D79=””,(WEEKDAY(D78)=5)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D78+4),0),))),IF(AND(D79=””,(WEEKDAY(D78)=6)),(INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D78+5),0),))))))))))))),"")


But when I break the formula in half and only do either the conditions of D79>1 or D79="" the formula works. I just can't seem to get them to work when adding them together.

Anyone see why this wouldn't return a value?
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You have some sloping quotes ” in there, they should all be vertical quotes "
 
Upvote 0
You're welcome & thanks for the feedback.
Looking at your formula you might be able to simplify it like
Excel Formula:
=IFERROR(IF(AND(D79>1,WEEKDAY(D79,2)<6),INDEX(Holidays!$G$2:$G$183,MATCH(TRUE,INDEX(Holidays!$G$2:$G$183>(D79+choose(WEEKDAY(d79,2),2,6,5,4,5)),0),)),if(and(d79="",weekday(d78)>1),...
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

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