Merging NETWORKDAYS and IF statements

lady_buzzkill

New Member
Joined
Oct 6, 2017
Messages
4
Hello everyone, I'm working on a spreadsheet for my job that will display the amount of time remaining to schedule an appointment or complete a report. The formula is working beautifully, with the exception of not being able to account for weekends and holidays. Can someone help me find a way to nest a NETWORKDAYS or other formula into my current string of IF formulas to get this working?

Please note that I haven't touched Excel in over a decade, so if my formula looks convoluted and you can streamline it, feel free. Here is what I currently have:

=IF(ISBLANK(A2),"", IF(NOT(ISBLANK(F2)),"Scheduled",IF(A2=(TODAY()-2),"24 Hours to Schedule",IF(A2=(TODAY()-1),"48 Hours to Schedule",IF(A2<=(TODAY()-3),"Schedule by EOB","")))))

Thanks!
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Maybe

=IF(A2="","", IF(F2<>"","Scheduled",LOOKUP(NETWORKDAYS(A2,TODAY())-1,{-100000,1,2,3},{"","48 Hours to Schedule","24 Hours to Schedule","Schedule by EOB"})))
 
Upvote 0
Here you go:

Code:
=IF(A2="","", IF(F2<>"","Scheduled",IF(A2=WORKDAY(TODAY(),-1)-1,"24 Hours to Schedule",IF(A2=WORKDAY(TODAY(),-1),"48 Hours to Schedule",IF(A2<=WORKDAY(TODAY(),-1)-2,"Schedule by EOB","")))))

Extra note:
If you also need to take bank holidays into account then put the bank holidays into a short column, say from J1:J8
Change the formula extra bit to WORKDAY(TODAY(),-1,$J$1:$J$8)
 
Last edited:
Upvote 0
I've just noticed I've been silly. Use this one:

=IF(A2="","", IF(F2<>"","Scheduled",IF(A2=WORKDAY(TODAY(),-2),"24 Hours to Schedule",IF(A2=WORKDAY(TODAY(),-1),"48 Hours to Schedule",IF(A2<=WORKDAY(TODAY(),-3),"Schedule by EOB","")))))
 
Upvote 0
Here you go:

Code:
=IF(A2="","",  IF(F2<>"","Scheduled",IF(A2=WORKDAY(TODAY(),-1)-1,"24 Hours to  Schedule",IF(A2=WORKDAY(TODAY(),-1),"48 Hours to  Schedule",IF(A2<=WORKDAY(TODAY(),-1)-2,"Schedule by  EOB","")))))
So, on a Tuesday, your formula will return a "Schedule by EOB" for the previous Friday's date. Somehow, I don't think that's what the OP wants.
 
Last edited:
Upvote 0
Somehow, I don't think that's what the OP wants.

I must admit that when I was typing it the output didn't seem to make a great deal of sense but the OP said that the original formula provided works.

All I did was wrap a WORKDAY function around TODAY.
 
Upvote 0
So, on a Tuesday, your formula will return a "Schedule by EOB" for the previous Friday's date. Somehow, I don't think that's what the OP wants.

Actually that IS what I want, but I want it to return "Schedule by EOB" on Wednesday for the previous Friday.

Basically what this does is it lets us know how long we have left to get something scheduled. We don't count the day we received the referral, so if we got something on Friday, it would have to be scheduled by end of business on Wednesday. The current formula is fine for that during the week. The weekends are tripping me up. So this is very close to what I need.

Does this help at all?
 
Upvote 0
I'm sorry, I realized MY calculations were wrong. Having it return Schedule by EOB on a Tuesday for the previous Friday is perfect. Does it also return 24 Hours to Schedule for Monday for the previous Friday? I'm not at my work computer atm so I cannot test for myself.
 
Upvote 0
The edited formula I gave you is the same as the first one you provided but i changed [today] to [workday before today]

Code:
[COLOR=#333333][FONT=Tahoma]=IF(A2="","",[/FONT][/COLOR][COLOR=#333333][FONT=Tahoma]IF(F2<>"","Scheduled",[/FONT][/COLOR][COLOR=#574123]IF(A2=WORKDAY(TODAY(),-2),"24 Hours to Schedule",[/COLOR][COLOR=#574123]IF(A2=WORKDAY(TODAY(),-1),"48 Hours to Schedule",[/COLOR][COLOR=#574123]IF(A2<=WORKDAY(TODAY(),-3),[/COLOR][COLOR=#574123]"Schedule by EOB",[/COLOR][COLOR=#574123]"")))))[/COLOR]

It reads as:

=IF(A2="","",
If A2 is blank say blank

IF(F2<>"","Scheduled",
If F2 is not blank say Scheduled

IF(A2=WORKDAY(TODAY(),-2),"24 Hours to Schedule",
If A2 is two working days ago say 24 hours to schedule

IF(A2=WORKDAY(TODAY(),-1),"48 Hours to Schedule",
If A2 is one working day ago say 48 hours to schedule

IF(A2<=WORKDAY(TODAY(),-3),
"Schedule by EOB",
If A2 is smaller than or equal to three working days ago say schedule by EOB

"")))))
If it does not fit any of these criteria be blank. (If there should never be a future date I would change this to "INVALID"))))) to flag incorrect entries.

Hope this helps you. Feel free to make changes to the formula so you get the output you want.
 
Last edited:
Upvote 0
Oh, and don't forget if you need extra holidays, like bank holidays then in the WORKDAY functions you will need to add the range for the additional dates.

Make sure you put $ before the columns and rows in the range e.g. WORKDAY(TODAY(),-2,$J$1:$J$8) so that when you drag the formula the cell references will not change.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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