Calculate Backdated dates

shansakhi

Active Member
Joined
Apr 5, 2008
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hello All,
Request your assistance to know how do I calculate below consider 30th Jun as base date.
For example
1 JUL if I do 1JUL-7 then it is less than 30 JUN and there passed the condition
10 JUL if I do 10 JUL-7 then it is grater than 30 JUN and hence I have to take 10JUL-14
.
.
.
6JAN if I do 6JAN-7 then it is grater than 30 JUN and hence I have to take 6JAN-196


30JUN is a dynamic date and will change to different date / also it date column will get extended to future years.

I am looking for a excel formula or either help in Power BI.

Book1
ABCDE
130-Jun-24
2DateDayLatest Back DateDay
31-Jul-24Monday24-Jun-24Monday
410-Jul-24Wednesday26-Jun-24Wednesday
520-Jul-24Saturday29-Jun-24Saturday
630-Jul-24Tuesday25-Jun-24Tuesday
79-Aug-24Friday28-Jun-24Friday
819-Aug-24Monday24-Jun-24Monday
929-Aug-24Thursday27-Jun-24Thursday
108-Sep-24Sunday30-Jun-24Sunday
1118-Sep-24Wednesday26-Jun-24Wednesday
1228-Sep-24Saturday29-Jun-24Saturday
138-Oct-24Tuesday25-Jun-24Tuesday
1418-Oct-24Friday28-Jun-24Friday
1528-Oct-24Monday24-Jun-24Monday
167-Nov-24Thursday27-Jun-24Thursday
1717-Nov-24Sunday30-Jun-24Sunday
1827-Nov-24Wednesday26-Jun-24Wednesday
197-Dec-24Saturday29-Jun-24Saturday
2017-Dec-24Tuesday25-Jun-24Tuesday
2127-Dec-24Friday28-Jun-24Friday
226-Jan-25Monday24-Jun-24Monday
Sheet1



Regards,
Shan
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Use this formula (in cell C3) and copy down:
Excel Formula:
=LET(d,WEEKDAY(A3)-WEEKDAY($A$1),IF(d=0,$A$1,IF(d<0,$A$1+d,$A$1-7+d)))

Results from your example:
1719934088347.png
 
Upvote 0
A slightly shorter one:
Excel Formula:
=A3-MAX(0,ROUNDUP((A3-$A$1)/7,0)*7)
Wow, that is really much simpler than my formula, and seems to give the exact same results as mine.
 
Upvote 0
Thank you, Joe4 and Tetra201.
Both the formulas are giving same result.
Thank you so much.
 
Upvote 0
You are welcome.
Glad we were able to help!
 
Upvote 0

Forum statistics

Threads
1,224,747
Messages
6,180,719
Members
452,995
Latest member
isldboy

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