Overlapping count times checking

quinnvu24

New Member
Joined
Jun 13, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi,

Below is the data. Is there any formula that define the specific hour or specific period that overlap 3 times. Overlap 2 times is fine.
I tried to separate the date and time then try Sum product but not work.
I also tried to design the hour for each date it was used however unsure how to design and display data.

Example is below 18/03/2024, 08:00PM - 09:00PM is overlapped 3 times.

Thanks all!
 

Attachments

  • Screenshot 2024-06-13 150335.png
    Screenshot 2024-06-13 150335.png
    35.1 KB · Views: 4

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 MrExcel forum!

I assumed that column A is the start of the period, and column B is the end of the period. If so, we can count how many intervals overlap with the following formula:

Book1
ABCD
118/03/2024 03:00 PM18/03/2024 08:00 PM3
218/03/2024 03:00 PM18/03/2024 08:00 PM3
318/03/2024 06:00 AM18/03/2024 10:00 PM6
418/03/2024 06:00 AM18/03/2024 10:00 PM6
518/03/2024 08:00 PM18/03/2024 10:00 PM4
618/03/2024 08:00 PM18/03/2024 09:00 PM4
718/03/2024 08:00 PM19/03/2024 12:00 AM5
818/03/2024 10:00 PM19/03/2024 06:00 AM2
918/03/2024 12:00 AM18/03/2024 06:00 AM0
1019/03/2024 03:00 PM19/03/2024 08:00 PM1
1119/03/2024 03:00 PM19/03/2024 08:00 PM1
1219/03/2024 06:00 AM19/03/2024 10:00 AM1
1319/03/2024 06:00 AM19/03/2024 10:00 AM1
1419/03/2024 08:00 PM19/03/2024 10:00 AM-1
1519/03/2024 08:00 PM20/03/2024 12:00 AM1
1619/03/2024 10:00 PM20/03/2024 06:00 AM1
1719/03/2024 12:00 AM19/03/2024 06:00 AM1
Sheet3
Cell Formulas
RangeFormula
D1:D17D1=SUM(--(IF(B1<B$1:B$17,B1,B$1:B$17)-IF(A1>A$1:A$17,A1,A$1:A$17)>0))-1


Note that the formula has -1 on the end, this is to subtract the case where the interval overlaps itself. Your example that row 6 overlaps 3 other ranges seems to be off, I counted 4 ranges, specifically rows 3, 4, 5, and 7. Also notice row 14 has a value of -1 which makes no sense. This is because the start time is after the end time. Is there a mistake in the table, or in my recreation of it?

Anyway, you can use the formula on the sheet if you want, or convert it to a Conditional Formatting formula to highlight the desired rows.
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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