Formula simplification request

willsing5130

New Member
Joined
Nov 10, 2024
Messages
2
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi everyone

Full disclosure... I started a similar thread on another forum, but for some reason I am unable to post a reply to it. I have tried several times without success. I hope that you all can help as I guess that this forum may share member with the other.

I created a simplified version of the full version to share on this post, but I am having difficulty with using the XL2BB addon.
In the full version, the data in column B grows throughout the year and usually reaches row 50 and beyond. The formula in column C can only encompass the data in B9 - B42 before it reaches the maximum character limit.
From the simplified version, I placed the data from column B, the formula in column C, and a screenshot of the spreadsheet below.
The data in Column B are pairs of start and end dates.
The formula in column C expands each pair of start/end dates into a set of sequential dates and times that are in 60 minute intervals. The interval is determined (in minutes) by cell E4.
I would appreciate help with a replacement formula that achieves the same outcomes as the current formula in column C. So far, I have not been able to develop a simplified version that works as well as the current version.

Data in column B
Consecutive Campaign Runs Collapsed - Raw
2024-02-20 11:55
2024-02-21 01:14
2024-03-21 01:14
2024-03-21 11:30

Formula in column C
=VSTACK(IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B10,$E$4/1440))-(FLOOR.MATH(B9,$E$4/1440)),0)),1,FLOOR.MATH(B9,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B10,$E$4/1440))-(FLOOR.MATH(B9,$E$4/1440)),0)),1,FLOOR.MATH(B9,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B9,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B10,$E$4/1440))-(FLOOR.MATH(B9,$E$4/1440)),0)),1,FLOOR.MATH(B9,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B10,$E$4/1440))),""),"No Data Available"),IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B12,$E$4/1440))-(FLOOR.MATH(B11,$E$4/1440)),0)),1,FLOOR.MATH(B11,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B12,$E$4/1440))-(FLOOR.MATH(B11,$E$4/1440)),0)),1,FLOOR.MATH(B11,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B11,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B12,$E$4/1440))-(FLOOR.MATH(B11,$E$4/1440)),0)),1,FLOOR.MATH(B11,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B12,$E$4/1440))),""),"No Data Available"),IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B14,$E$4/1440))-(FLOOR.MATH(B13,$E$4/1440)),0)),1,FLOOR.MATH(B13,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B14,$E$4/1440))-(FLOOR.MATH(B13,$E$4/1440)),0)),1,FLOOR.MATH(B13,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B13,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B14,$E$4/1440))-(FLOOR.MATH(B13,$E$4/1440)),0)),1,FLOOR.MATH(B13,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B14,$E$4/1440))),""),"No Data Available"),IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B16,$E$4/1440))-(FLOOR.MATH(B15,$E$4/1440)),0)),1,FLOOR.MATH(B15,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B16,$E$4/1440))-(FLOOR.MATH(B15,$E$4/1440)),0)),1,FLOOR.MATH(B15,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B15,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B16,$E$4/1440))-(FLOOR.MATH(B15,$E$4/1440)),0)),1,FLOOR.MATH(B15,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B16,$E$4/1440))),""),"No Data Available"))
 

Attachments

  • Help request - formula simplification.JPG
    Help request - formula simplification.JPG
    209.4 KB · Views: 14

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Welcome to the Forum!

Full disclosure... I started a similar thread on another forum ...
Thanks for this, but please provide the link next time, which in this case is: Formula Simplification

And if you will always be using Excel 365, it would be good if you could update your Account details.

Give this a try:

ABCDE
1
2
3
4120
5
6
7
8
920 Feb 2024 11:5520 Feb 2024 10:00
1021 Feb 2024 1:1420 Feb 2024 12:00
1121 Mar 2024 1:1420 Feb 2024 14:00
1221 Mar 2024 11:3020 Feb 2024 16:00
137 Apr 2024 10:0520 Feb 2024 18:00
147 Apr 2024 16:4520 Feb 2024 20:00
1520 Feb 2024 22:00
1621 Feb 2024 0:00
1721 Feb 2024 2:00
1821 Mar 2024 0:00
1921 Mar 2024 2:00
2021 Mar 2024 4:00
2121 Mar 2024 6:00
2221 Mar 2024 8:00
2321 Mar 2024 10:00
2421 Mar 2024 12:00
257 Apr 2024 10:00
267 Apr 2024 12:00
277 Apr 2024 14:00
287 Apr 2024 16:00
297 Apr 2024 18:00
30
31
Sheet1
Cell Formulas
RangeFormula
C9:C29C9=LET(d,B9:B14,seq,SEQUENCE(ROWS(d)/2,,,2),s,FLOOR(INDEX(d,seq),E4/1440),N,ROUND(1+(CEILING(INDEX(d,1+seq),E4/1440)-s)*1440/E4,0),m,SEQUENCE(,MAX(N),0),TOCOL(IFS(m<N,s+m*E4/1440),2))
Dynamic array formulas.

I don't know if your time ranges can overlap? If so, you may want to wrap in UNIQUE() to eliminate duplicate times where the overlaps occur.
 
Upvote 0
Solution
Full disclosure... I started a similar thread on another forum
Welcome to the MrExcel board & thanks for telling us that you have posted elsewhere as well (cross-post).
As well as telling us about cross-posts, in the future please also provide links to them per #13 of the Forum Rules.

Be sure to follow & read the link at the end of the rule too!

If you do cross-post in the future and also provide links, then there shouldn’t be a problem. :)


but I am having difficulty with using the XL2BB addon.
Could that problem be this? XL2BB Icons greyed out
 
Upvote 0
Thanks! Works like a charm!
Just checking as I notice there are a couple of differences in the results between your formula and Stephen's. I have not tried to decipher either formula and these differences may or may not matter to you.
  • I have extended the range in Stephen's formula to include some empty cells in column B as I noticed that your formula had a provision for "No Data Available". Consequently there is a difference in the red cells at the bottom of the ranges below

  • As you can see there is also an extra result in C17 that is not in the post #1 formula results.
24 11 12.xlsm
BCDE
4120
5
6
7
8Post #2 FormulaPost #1 Formula
920 Feb 24 11:5520 Feb 24 10:0020 Feb 24 10:00
1021 Feb 24 1:1420 Feb 24 12:0020 Feb 24 12:00
1121 Mar 24 1:1420 Feb 24 14:0020 Feb 24 14:00
1221 Mar 24 11:3020 Feb 24 16:0020 Feb 24 16:00
1307 Apr 24 10:0520 Feb 24 18:0020 Feb 24 18:00
1407 Apr 24 16:4520 Feb 24 20:0020 Feb 24 20:00
1520 Feb 24 22:0020 Feb 24 22:00
1621 Feb 24 0:0021 Feb 24 0:00
1721 Feb 24 2:0021 Mar 24 0:00
1821 Mar 24 0:0021 Mar 24 2:00
1921 Mar 24 2:0021 Mar 24 4:00
2021 Mar 24 4:0021 Mar 24 6:00
2121 Mar 24 6:0021 Mar 24 8:00
2221 Mar 24 8:0021 Mar 24 10:00
2321 Mar 24 10:0021 Mar 24 12:00
2421 Mar 24 12:0007 Apr 24 10:00
2507 Apr 24 10:0007 Apr 24 12:00
2607 Apr 24 12:0007 Apr 24 14:00
2707 Apr 24 14:0007 Apr 24 16:00
2807 Apr 24 16:0007 Apr 24 18:00
2907 Apr 24 18:00No Data Available
3000 Jan 00 0:00
31
willsing5130
Cell Formulas
RangeFormula
C9:C30C9=LET(d,B9:B16,seq,SEQUENCE(ROWS(d)/2,,,2),s,FLOOR(INDEX(d,seq),E4/1440),N,ROUND(1+(CEILING(INDEX(d,1+seq),E4/1440)-s)*1440/E4,0),m,SEQUENCE(,MAX(N),0),TOCOL(IFS(m<N,s+m*E4/1440),2))
D9:D29D9=VSTACK(IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B10,$E$4/1440))-(FLOOR.MATH(B9,$E$4/1440)),0)),1,FLOOR.MATH(B9,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B10,$E$4/1440))-(FLOOR.MATH(B9,$E$4/1440)),0)),1,FLOOR.MATH(B9,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B9,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B10,$E$4/1440))-(FLOOR.MATH(B9,$E$4/1440)),0)),1,FLOOR.MATH(B9,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B10,$E$4/1440))),""),"No Data Available"),IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B12,$E$4/1440))-(FLOOR.MATH(B11,$E$4/1440)),0)),1,FLOOR.MATH(B11,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B12,$E$4/1440))-(FLOOR.MATH(B11,$E$4/1440)),0)),1,FLOOR.MATH(B11,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B11,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B12,$E$4/1440))-(FLOOR.MATH(B11,$E$4/1440)),0)),1,FLOOR.MATH(B11,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B12,$E$4/1440))),""),"No Data Available"),IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B14,$E$4/1440))-(FLOOR.MATH(B13,$E$4/1440)),0)),1,FLOOR.MATH(B13,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B14,$E$4/1440))-(FLOOR.MATH(B13,$E$4/1440)),0)),1,FLOOR.MATH(B13,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B13,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B14,$E$4/1440))-(FLOOR.MATH(B13,$E$4/1440)),0)),1,FLOOR.MATH(B13,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B14,$E$4/1440))),""),"No Data Available"),IFERROR(FILTER(SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B16,$E$4/1440))-(FLOOR.MATH(B15,$E$4/1440)),0)),1,FLOOR.MATH(B15,$E$4/1440),$E$4/1440),((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B16,$E$4/1440))-(FLOOR.MATH(B15,$E$4/1440)),0)),1,FLOOR.MATH(B15,$E$4/1440),$E$4/1440))>=(FLOOR.MATH(B15,$E$4/1440)))*((SEQUENCE(24*4*(ROUNDUP((CEILING.MATH(B16,$E$4/1440))-(FLOOR.MATH(B15,$E$4/1440)),0)),1,FLOOR.MATH(B15,$E$4/1440),$E$4/1440))<=(CEILING.MATH(B16,$E$4/1440))),""),"No Data Available"))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

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