Function to find previous working day

JonnnyExcel

New Member
Joined
Feb 9, 2011
Messages
8
I am trying to figure out a function to find the last working day that is not a weekend or holiday. I have searched this board and others and can’t find a function to do this task.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I have found a formula to make sure the previous day is not a weekend “=IF(WEEKDAY(B6)=7,B6-1,IF(WEEKDAY(B6)=1,B6-2,B6”, where B6 is the cell with date being checked. <o:p></o:p>
<o:p></o:p>
I have a Vlookup to find out if the date in B6 is a holiday “=IFERROR(VLOOKUP(B6,G2:G4,1,FALSE),0” where the holidays are listed in cells, G2 to G4.<o:p></o:p>
<o:p></o:p>
I am struggling to piece these 2 formulas together as the previous could be a weekend or a holiday. <o:p></o:p>
For example, our company doesn’t work Thanksgiving Day and the following day (11/24, 11/25/2011). On Monday (11/28/2011) the previous working day is Wednesday 11/23/2011.<o:p></o:p>
<o:p></o:p>
I am aware of the workdays and networkdays functions in Excel but can’t seem to get them to work in my case.<o:p></o:p>
<o:p></o:p>
Any help would be appreciated, thank you.<o:p></o:p>

Jon
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Welcome to the board...

It's the workday function you want here..


If you're looking for the previous workday (from today) then

=WORKDAY(TODAY(),-1,F1:F20)

F1:F20 is a list of holidays that you must create.


You can replace TODAY() with any cell reference that contains the date you want to get the workday prior from.


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,224,596
Messages
6,179,807
Members
452,944
Latest member
2558216095

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