Weekday and Workday Formula gives Value Error in terms of calculating actual due dates

Clash Royale CLAN TAG#URR8PPPWeekday and Workday Formula gives Value Error in terms of calculating actual due dates
I'm working on calculating our work completion dates, and I want to think I have a pretty good understanding of IF statements, but I can't seem to figure this one out at all.
So we have three products: policy, quotes and rating, and they each have their own service times/dates process.
- If a policy is requested before 4 pm, then it has to be completed the same day, otherwise if it comes in after 4:00 pm, then you have till 11:59 the next day.
- With quotes you have 48 hours to complete them, and with rating you have 7 days.
I also have a lookup sheet which references company holidays, and I decided to use workday function because some services get in on Fridays, and we are only count weekdays when calculating our due dates. I have also attached my formula in text below, do you guys think that I'm messing up in terms of how I am using both (OR) and (AND) functions to nest the IF statement?
=IF(OR(WEEKDAY(IF(A2="Quote",D2+2,IF(A2="Rating",Q2+7,"")))=1,WEEKDAY(IF(A2="Quote",D2+2,IF(A2="Rating",D2+7,""))=7),
IF(A2="Quote",D2+2,IF(A2="Rating",D2+7,""))+2,
IF(A2="Quote",D2+2,IF(A2="Rating",D2+7,""))),
IF(OR(A2="Policy",HOUR(C2<=16),INT(C2)+TIME(23,59,0)),
IF(OR(A2="Policy",HOUR(C2)>16),WORKDAY(D2,1,Lookup!$M$2:$M$20)+TIME(23,59,0),"ERROR"))
Photo of work and columns
IF
WEEKDAY
=WEEKDAY("")
So to be clear, for ratings if today is Monday the 1st then you have until Wednesday the 10th to complete?
– jeffreyweir
20 mins ago
And do any requests come in on a weekend?
– jeffreyweir
7 mins ago
1 Answer
1
If I've understood your requirements correctly, then you should be able to use =IF(A2="Policy",IF(HOUR(C2)<16,D2,WORKDAY(D2,1)), WORKDAY(D2,IF(A2="Quote",1,IF(A2="Rating",7,0))))
=IF(A2="Policy",IF(HOUR(C2)<16,D2,WORKDAY(D2,1)), WORKDAY(D2,IF(A2="Quote",1,IF(A2="Rating",7,0))))
That just returns a date. If you want it to return a datetime, then I can amend.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Using the Formula Ribbon > Evaluate Formula should help you debug this. For starters, when the
IFformulas within aWEEKDAYformula resolve to an empty string, you've already got an error. I.e. you can't do=WEEKDAY("").– BigBen
1 hour ago