Expand Start/End date into single column list of dates.

HereToday

New Member
Joined
Aug 26, 2022
Messages
3
Office Version
  1. 365
Platform
  1. MacOS
First post on this forum. Running M365 (Excel Mac).

I've got a workaround for this but I'm looking for a more elegant solution.

In essence I'd like to create a non-VBA function that expands a start/end date range into series of dates, starting with first start date, listing all dates between first start and end date, then iterating to the next start date and so on, until the end of a table range is reached.

ATM, I've got a work around that uses 3 hidden helper columns, which works but is quite clunky.

Column N: I list all dates in a year (static sequence of numbers).
Column O: use the following function to compare Column 1 dates to original table start/end dates: =IF(SUM((N14 >= $C$4:$C$6)*(N14 <= $D$4:$D$6)),N14,"")
Where C is start date, D is end Date, N is Column 1.
Column P: using the Unique function to pull column O into a single list, without spaces or gaps.

So whilst i have a "method" of achieving what's shown in the screen shot it's far from elegant. Any ideas about a better way of achieving the same thing?



Is there any method of achieving the same result in one "hit"?
 

Attachments

  • Screenshot 2022-08-26 at 11.17.20.png
    Screenshot 2022-08-26 at 11.17.20.png
    191.4 KB · Views: 35

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
How about
Fluff.xlsm
CDEF
1
212/01/202226/01/202212/01/2022
328/01/202211/02/202213/01/2022
415/02/202201/03/202214/01/2022
515/01/2022
616/01/2022
717/01/2022
818/01/2022
919/01/2022
1020/01/2022
1121/01/2022
1222/01/2022
1323/01/2022
1424/01/2022
1525/01/2022
1626/01/2022
1728/01/2022
1829/01/2022
1930/01/2022
2031/01/2022
2101/02/2022
2202/02/2022
2303/02/2022
2404/02/2022
2505/02/2022
2606/02/2022
2707/02/2022
2808/02/2022
2909/02/2022
3010/02/2022
3111/02/2022
3215/02/2022
3316/02/2022
3417/02/2022
3518/02/2022
3619/02/2022
3720/02/2022
3821/02/2022
3922/02/2022
4023/02/2022
4124/02/2022
4225/02/2022
4326/02/2022
4427/02/2022
4528/02/2022
4601/03/2022
47
Report
Cell Formulas
RangeFormula
F2:F46F2=LET(a,C2:C4,b,D2:D4,s,SEQUENCE(365,,C2),FILTER(s,BYROW(s,LAMBDA(br,SUM(--(br>=a),--(br<=b))>ROWS(a)))))
Dynamic array formulas.
 
Upvote 0
Hi

Excel 365 Beta

=LET(K,C2:C4-B2:B4,x,MAX(K),y,SEQUENCE(,x),HSTACK(TOCOL(IF(y<=K,A2:A4,#N/A),3),TOCOL(IF(y<=K,y+B2:B4-1,#N/A),3)))
 
Last edited:
Upvote 0
@ISY when posting solutions that are only available to people on the Beta channel, please make that clear.
 
Upvote 0
How about
Fluff.xlsm
CDEF
1
212/01/202226/01/202212/01/2022
328/01/202211/02/202213/01/2022
415/02/202201/03/202214/01/2022
515/01/2022
616/01/2022
717/01/2022
818/01/2022
919/01/2022
1020/01/2022
1121/01/2022
1222/01/2022
1323/01/2022
1424/01/2022
1525/01/2022
1626/01/2022
1728/01/2022
1829/01/2022
1930/01/2022
2031/01/2022
2101/02/2022
2202/02/2022
2303/02/2022
2404/02/2022
2505/02/2022
2606/02/2022
2707/02/2022
2808/02/2022
2909/02/2022
3010/02/2022
3111/02/2022
3215/02/2022
3316/02/2022
3417/02/2022
3518/02/2022
3619/02/2022
3720/02/2022
3821/02/2022
3922/02/2022
4023/02/2022
4124/02/2022
4225/02/2022
4326/02/2022
4427/02/2022
4528/02/2022
4601/03/2022
47
Report
Cell Formulas
RangeFormula
F2:F46F2=LET(a,C2:C4,b,D2:D4,s,SEQUENCE(365,,C2),FILTER(s,BYROW(s,LAMBDA(br,SUM(--(br>=a),--(br<=b))>ROWS(a)))))
Dynamic array formulas.
Well that is just neat as ninepence! It's going to take me a while to work through the formula to understand it but many, many thanks!
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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