Date formula

jbrown021286

Board Regular
Joined
Mar 13, 2023
Messages
61
Office Version
  1. 365
Platform
  1. Windows
Is there a formal that can take a date referenced in a cell then output the date of the previous Sunday? For example cell a1 has =today() ( let's say it is outputting the date 2/14/2024 ) I would need the formula in b1 to output the date 2/11/2024.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
This was also described in your earlier question, here:
In POST #4.
 
Upvote 0
Try this in B1:

=WORKDAY.INTL(A1,-1,"1111110")
if the start date is a Sunday and you want that as your answer the formula needs to be updated by advancing the start date one day:
Excel Formula:
=WORKDAY.INTL(A1+1,-1,"1111110")
 
Upvote 0
Solution
if the start date is a Sunday and you want that as your answer the formula needs to be updated by advancing the start date one day:
Excel Formula:
=WORKDAY.INTL(A1+1,-1,"1111110")
Thanks
if the start date is a Sunday and you want that as your answer the formula needs to be updated by advancing the start date one day:
Excel Formula:
=WORKDAY.INTL(A1+1,-1,"1111110")
That updated formula outputs the same date as the refrance date. A1,-1 comes back with the last Sunday date. Is there a way to make it where if the input date in a1 is a Sunday it count that as the last sunday?
 
Upvote 0
I don't understand your question. If the reference date is Sunday, do you want to start with that date as the "last Sunday"? Maybe you can give a table of expectations:
Which do you want to see for the expected "Last Sunday" of 2/18. If you're doing a Week To Date starting 2/18, I would think you want 2/18?
Reference Date:Sun 2/18Mon 2/19Tue 2/20Wed 2/21Thu 2/22Fri 2/23Sat 2/24
Expected Last SundaySun 2/18 or 2/11Sun 2/18Sun 2/18Sun 2/18Sun 2/18Sun 2/18Sun 2/18
If you want 2/18: =WORKDAY.INTL(A1+1,-1,"1111110")
If you want 2/11 =WORKDAY.INTL(A1,-1,"1111110")
 
Upvote 0
Sry about that wasn't thinking about it being after midnight and not Saturday anymore. You formula worked perfectly thanks
 
Upvote 0
I think this one also does what you want?
Excel Formula:
=A1+1-WEEKDAY(A1+7)
 
Upvote 0

Forum statistics

Threads
1,215,079
Messages
6,123,009
Members
449,093
Latest member
ikke

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