How to get unique date and time between two dates?

worldCurrencies

New Member
Joined
Mar 7, 2022
Messages
17
Office Version
  1. 365
Platform
  1. Windows
I haven't found an answer that includes time.
Threshold DatesDateTimeResult
1/9/20231/9/20238:00:00{=SORT(UNIQUE(FILTER(CONCATENATE(TEXT($B$2:$B$6,"m/d/yyyy")," ",$C$2:$C$6),(List!$B$2:$B$6>=$A$2)*($B$2:$B$6<=$A$3),"no result"),FALSE,TRUE))}
1/13/20231/8/202310:00:00
1/10/20238:30:00
1/10/202310:00:00
1/13/20232:30:00

The array formula i have in column D half-way does the trick. It gives me unique dates within that time frame, however, i am looking to include time as well. It gives me the output below:

1/9/2023 8:00:00
1/10/2023 8:30:00
1/13/2023 2:30:00

I am trying to include the second 1/10 date into the answer as well
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
I am not sure I am understanding correctly but try the below.
See if this is what you had in mind.

Excel Formula:
=LET(date_time,  B2:B6+C2:C6,
         fltr_result,   FILTER(date_time, (date_time>=A2) * (date_time<(A3+1)), "no result"),
         SORT(UNIQUE(  fltr_result  )))
 
Upvote 0
I think this should produce the same result. My dates are d/m/y format.


23 01 14.xlsm
ABCD
1Threshold DatesDateTimeResult
29/01/20239/01/20238:00:009/1/2023 8:00:00
313/01/20238/01/202310:00:0010/1/2023 8:30:00
410/01/20238:30:0010/1/2023 10:00:00
510/01/202310:00:0013/1/2023 2:30:00
613/01/20232:30:00
Date Time
Cell Formulas
RangeFormula
D2:D5D2=SORT(UNIQUE(FILTER(B2:B6+C2:C6,(B2:B6>=A2)*(B2:B6<=A3),"")))
Dynamic array formulas.

.. or would you want that last row excluded from the results?
If so would it be possible for any of your times to be 0:00:00?
 
Upvote 0
I think this should produce the same result. My dates are d/m/y format.


23 01 14.xlsm
ABCD
1Threshold DatesDateTimeResult
29/01/20239/01/20238:00:009/1/2023 8:00:00
313/01/20238/01/202310:00:0010/1/2023 8:30:00
410/01/20238:30:0010/1/2023 10:00:00
510/01/202310:00:0013/1/2023 2:30:00
613/01/20232:30:00
Date Time
Cell Formulas
RangeFormula
D2:D5D2=SORT(UNIQUE(FILTER(B2:B6+C2:C6,(B2:B6>=A2)*(B2:B6<=A3),"")))
Dynamic array formulas.

.. or would you want that last row excluded from the results?
If so would it be possible for any of your times to be 0:00:00?
No, this is perfect. Everybody’s answers worked. I appreciate it!!
 
Upvote 0
You're welcome. Glad we could help. Thanks for the follow-up. :)

(Of course if your dates and times are chronological like you sample, then you wouldn't need the SORT function)
 
Upvote 0

Forum statistics

Threads
1,215,706
Messages
6,126,334
Members
449,309
Latest member
kevinsucher

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