Weekdays function

Oldham_mark

New Member
Joined
Jan 28, 2015
Messages
2
Hi

I am trying to find a formula that will bring up the previous working day if the day I input is not a working day (due to either a weekend or Bank Holiday). If the day input is a working day I would like to bring back that day.

If I input a date in cell A1, and wish to return the corrected date in cell B1, what formula would I need in B1?

I have been using =WEEKDAY(A1+1,-1) but this only corrects the date for weekends, not Bank Holidays

Many Thanks
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Weekday has a provision for holidays as an optional 3rd argument. Put your bank holidays into a list and either create a named range and use that in your formula or just use the cell references with the bank holiday dates in them.
 
Upvote 0
Sorry meant workday! This for example:

=IF(WORKDAY(A1-1,1,holidays)=A1,A1,WORKDAY(A1,-1,holidays))
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,702
Members
448,980
Latest member
CarlosWin

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