Return date of next instance

IluvPivots

Board Regular
Joined
Feb 13, 2007
Messages
146
Office Version
  1. 2016
Excel 2016. What would the formula be in the End date column? I want it to return the date of the next instance of "ENDDATE". The end date for week 10/5/2024 is 10/26/2024. See example column.



DateLabelEND DATEExample of result
10/5/2024​
10/26/2024​
10/12/2024​
10/26/2024​
10/19/2024​
10/26/2024​
10/26/2024​
ENDDATE
10/26/2024​
11/2/2024​
11/30/2024​
11/9/2024​
11/30/2024​
11/16/2024​
11/30/2024​
11/23/2024​
11/30/2024​
11/30/2024​
ENDDATE
11/30/2024​
12/7/2024​
12/28/2024​
12/14/2024​
12/28/2024​
12/21/2024​
12/28/2024​
12/28/2024​
ENDDATE
12/28/2024​
1/4/2025​
2/1/2025​
1/11/2025​
2/1/2025​
1/18/2025​
2/1/2025​
1/25/2025​
2/1/2025​
2/1/2025​
ENDDATE
2/1/2025​
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hello, one option could be:

Excel Formula:
=INDEX(A2:A$19,MATCH("ENDDATE",B2:B$19,0))
 
Upvote 0
Excel 2016. What would the formula be in the End date column? I want it to return the date of the next instance of "ENDDATE". The end date for week 10/5/2024 is 10/26/2024. See example column.



DateLabelEND DATEExample of result
10/5/2024​
10/26/2024​
10/12/2024​
10/26/2024​
10/19/2024​
10/26/2024​
10/26/2024​
ENDDATE
10/26/2024​
11/2/2024​
11/30/2024​
11/9/2024​
11/30/2024​
11/16/2024​
11/30/2024​
11/23/2024​
11/30/2024​
11/30/2024​
ENDDATE
11/30/2024​
12/7/2024​
12/28/2024​
12/14/2024​
12/28/2024​
12/21/2024​
12/28/2024​
12/28/2024​
ENDDATE
12/28/2024​
1/4/2025​
2/1/2025​
1/11/2025​
2/1/2025​
1/18/2025​
2/1/2025​
1/25/2025​
2/1/2025​
2/1/2025​
ENDDATE
2/1/2025​
Will the end date always be the last Saturday in the month? If it is then the Label column won't be needed.

=SUM(IF(WEEKDAY(EOMONTH($A2,0)-{0,1,2,3,4,5,6})=7,EOMONTH($A2,0)-{0,1,2,3,4,5,6}),0)
 
Upvote 0
Will the end date always be the last Saturday in the month? If it is then the Label column won't be needed.

=SUM(IF(WEEKDAY(EOMONTH($A2,0)-{0,1,2,3,4,5,6})=7,EOMONTH($A2,0)-{0,1,2,3,4,5,6}),0)
This is awesome! However, the business rule states end of month is the last saturday UNLESS the first day of next month is on a saturday.
 
Upvote 0
This is awesome! However, the business rule states end of month is the last saturday UNLESS the first day of next month is on a saturday.
=IF(WEEKDAY((EOMONTH($A2,0)+1))=7,EOMONTH($A2,0)+1,SUM(IF(WEEKDAY(EOMONTH($A2,0)-{0,1,2,3,4,5,6})=7,EOMONTH($A2,0)-{0,1,2,3,4,5,6}),0))

For testing purposes, the following dates are the first day of the month where it is a Saturday. UK date formatting.

01/02/2025
01/03/2025
01/11/2025
01/08/2026
01/05/2027
01/01/2028
01/04/2028
01/07/2028
01/09/2029
01/12/2029
01/06/2030
 
Upvote 0
Solution
=IF(WEEKDAY((EOMONTH($A2,0)+1))=7,EOMONTH($A2,0)+1,SUM(IF(WEEKDAY(EOMONTH($A2,0)-{0,1,2,3,4,5,6})=7,EOMONTH($A2,0)-{0,1,2,3,4,5,6}),0))

For testing purposes, the following dates are the first day of the month where it is a Saturday. UK date formatting.

01/02/2025
01/03/2025
01/11/2025
01/08/2026
01/05/2027
01/01/2028
01/04/2028
01/07/2028
01/09/2029
01/12/2029
01/06/2030
Wow!! Where has this formula been all my time in this job! Spectacular! Many thanks.
 
Upvote 0
IluvePivots,
In the future, when marking a post as the solution, please mark the original post containing the solution (and not your own post acknowledging that some other post is the solution).
I have updated this thread for you.
 
Upvote 0
Another option:

Book1
ABCDE
1DateLabelEND DATEExample of result
210/5/202410/26/202410/26/2024
310/12/202410/26/202410/26/2024
410/19/202410/26/202410/26/2024
510/26/2024ENDDATE10/26/202410/26/2024
611/2/202411/30/202411/30/2024
711/9/202411/30/202411/30/2024
811/16/202411/30/202411/30/2024
911/23/202411/30/202411/30/2024
1011/30/2024ENDDATE11/30/202411/30/2024
1112/7/202412/28/202412/28/2024
1212/14/202412/28/202412/28/2024
1312/21/202412/28/202412/28/2024
1412/28/2024ENDDATE12/28/202412/28/2024
151/4/20252/1/20252/1/2025
161/11/20252/1/20252/1/2025
171/18/20252/1/20252/1/2025
181/25/20252/1/20252/1/2025
192/1/2025ENDDATE2/1/20252/1/2025
Sheet1
Cell Formulas
RangeFormula
C2:C19C2=INDEX(A2:$A$19,MATCH("ENDDATE",B2:$B$19,0))
thank you
 
Upvote 0

Forum statistics

Threads
1,221,479
Messages
6,160,072
Members
451,616
Latest member
swgrinder

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