Transforming weekend date to previous Friday

RaydenUK

Board Regular
Joined
Mar 25, 2014
Messages
74
Is there a code or formula that would convert a weekend date to the previous friday at 11:59pm? For example: in cell A1 I have "5/23/15 8:37", which is a saturday. How could I have that number transformed into "5/22/15 23:59", which is the friday prior to that saturday? I have several other dates in my list that do not end on the weekend and those need to stay the same. Any help would be greatly appreciated.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
You'll need WEEKDAY(date) to retrieve the condition to calculate on. There are several modes.
=IF(OR(WEEKDAY(B9,2)=6,WEEKDAY(B9,2)=7),(DATE(YEAR(B9),MONTH(B9),DAY(B9)+5-WEEKDAY(B9,2)))+(0.999305555555556),B9)
 
Upvote 0
Try

=WORKDAY(A1+1,-1)+MOD(A1,1)

I like the simplicity, but the time constraint doesn't come out right. Is there a good method to capture that 23:59 constraint in your formula?
 
Upvote 0
Looks like I missed the part about making it specifically 11:59 PM.
I assumed we wanted the time to be the same as the original cell's time..

Try
=WORKDAY(A1+1,-1)+"23:59:00"
 
Upvote 0

Forum statistics

Threads
1,214,824
Messages
6,121,784
Members
449,049
Latest member
greyangel23

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