Working with Dates in Excel

manishseth

New Member
Joined
Jul 26, 2018
Messages
1
On the heading of my weekly report I wanted the week start date "Saturday" and the end date "Friday" should show automatically when I open the sheet and should change with the date of the month automatically. I did not want to change it manually every week. I achieved the same by the below formula.

My Question: Is there any smarter way to get the same results?

Result: 21-07-18 to 28-07-18

Formula: =TEXT(IF(WEEKDAY(TODAY())=7,TODAY(),TODAY()-WEEKDAY(TODAY())),"DD-mm-YY")&" to "&TEXT(IF(WEEKDAY(TODAY())=7,TODAY()+(WEEKDAY(TODAY())),TODAY()+(6-WEEKDAY(TODAY()))),"DD-MM-YY")
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Not much shorter.

=TEXT(TODAY()-MOD(WEEKDAY(TODAY()),7),"dd-mm-yy") &" to "&TEXT(TODAY()-MOD(WEEKDAY(TODAY()),7)+7, "dd-mm-yy")
 
Upvote 0
A shorter formula:

=TEXT(INT(TODAY()/7)*7,"dd-mm-yy to ")&TEXT(INT(TODAY()/7)*7+6,"dd-mm-yy")

If your version of Excel has TEXTJOIN, here is an even shorter one:

=TEXTJOIN(" to ",,TEXT(INT(TODAY()/7)*7+{0,6},"dd-mm-yy"))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,191
Members
453,021
Latest member
pingpong7117

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