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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
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,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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