formula to count how many ranges of values a number fits between

qwerty2k1

New Member
Joined
Jun 11, 2015
Messages
2
I've been searching around for a way to do this but have had no luck so far.

Say I have a bunch of ranges of times. The start time is in Column A, and the end time is in Column B. These ranges overlap, often, so I might have:
A B
0 6
4 6
7 11
16 18


I have another column, column C, and I want to see how many of the ranges above the numbers in column C fit into.

So, if I have:
C
1
5
8
10
15

Then I want my outcome to be
D
1
2
1
1
0

Thank you for any help!
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Welcome to the board.
If you have XL2007+ Try

=COUNTIFS(A$1:A$4,"<="&C1,B$1:B$4,">="&C1)
 
Upvote 0
Thank you! I hadn't thought that would keep the adjacent cells in columns A and B paired, but it seems to accomplish that. Is that the work of the $? I'm somewhat familiar with $ in excel but I hadn't thought it would work that way here.
 
Upvote 0

Forum statistics

Threads
1,215,830
Messages
6,127,134
Members
449,361
Latest member
VBquery757

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