Date Question

tyija1995

Well-known Member
Joined
Feb 26, 2019
Messages
781
Office Version
  1. 365
Platform
  1. Windows
Hi all,

Hopefully a simple solution to this question, I want to basically return the date of the Friday just passed in "ddmmyyyy" format, so a formula to return 19072019 in the example of today's date.
If the date were Thu 12th September I'd want 06092019 - if the date is a Friday then stay as is (so Fri 13th September would be 13092019)

I recognise I can do this with a very long nested IF statement checking each day, but surely there is a more efficient way?

Thanks :-)

Note: I want an Excel solution and NOT VBA
 
Last edited:

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Hi there. Try this - it assumes your date is in M2, but just replace M2 with Today() if you always want today.

=TEXT(M2-MOD(WEEKDAY(M2)+1,7),"ddmmyyyy")
 
Last edited:
Upvote 0
Thanks for the feedback. Out of curiosity, which one did you go with?
 
Upvote 0
Thanks for the feedback. Out of curiosity, which one did you go with?

Hi John,

I went with the answer trunten provided. I tried both though and yours worked too!
 
Last edited:
Upvote 0
Another approach that you can consider particularly if you do not want a text result.


Excel 2010
DEFG
219072019Text
319072019Custom format "ddmmyyy"
419072019Custom format "ddmmyyy"
5
4a
Cell Formulas
RangeFormula
D2=TEXT(TODAY()+(1-WEEKDAY(TODAY(),15)),"ddmmyyyy")
D3=TODAY()+(1-WEEKDAY(TODAY(),15))
D4=WORKDAY.INTL(TODAY(),-1,"1111011")
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,771
Members
452,353
Latest member
strainu

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