# Formula to Count Most Available Time

1. ## Formula to Count Most Available Time

So, I need a formula that will count whether a time is included in a range of times and return the total number of times that it is include.

For example, one range shows:
In Out
10:00 AM 12:00 PM
8:30 AM 12:30 PM
8:00 AM 9:00 AM
2:00 PM 5:00 PM

The second range shows:
Start End Count
8:00 AM 8:30 AM 1
8:30 AM 9:00 AM 2
9:00 AM 9:30 AM 1
9:30 AM 10:00 AM 1
and so on.

I need a formula that will automatically do the count, though. I've tried a variety of formulas, but have found nothing so far that will work with time ranges like this. Does anyone else know a formula that will do this?

FYI, I posted this question on Yahoo Answers, though it's worded very differently and is open to solutions from other programs - http://answers.yahoo.com/question/in...4101602AAOcFP0 .

2. ## Re: Formula to Count Most Available Time

If your first range is in A2:B5 and your 2nd range in D2:E5 then in F2:

=COUNTIFS(A2:A5, "<=" & D2, B2:B5, ">=" & E2)

Should do it.

There are currently 1 users browsing this thread. (0 members and 1 guests)