Count number of times a date is inbewteen 2 date ranges

AllyGee

New Member
Joined
Aug 24, 2011
Messages
3
Hi can anybody help me out with me excel problem. I have a list of training courses and need to count how many courses I have on each day and the number of students to make sure that I (a) dont have more courses than trainers and (b) dont have too many people out of the office at any one time. my spreadsheet is set up like this--
Column A -course name
column B- start date of course
Column C - end date of course
Column D - number of students on course

I dont know if this makes a difference but the courses are listed as they are booked and are not always in date order.

Example

Course A, 01/09/11, 03/09/11, 10
Course B, 02/09/11, 04/09/11, 5
Course C, 10/11/11, 10/11/11, 6
Course D, 01/09/11, 02/09/11, 7

Thanks
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
=SUMIFS(G7:G10,E7:E10,"<="&F4,F7:F10,">="&F4)

using your date - g7:g10 is the number of students on the course, e7:e10 is the start date, f7:f10 is the end date and f4 is the date you are testing for

This will only work in excel 2007, because sumifs isn't in 2003. If you have 2003 you will have to use this formula, but you need to hit control shift and enter after you type in the formula, not just enter.

=SUM(IF(E7:E10<=F4,IF(F7:F10>=F4,G7:G10)))
 
Upvote 0
Thanks I have 2007 at home and it works great (2003 at work so will give that a go tomorrow). If I change the formula to a countif in a separate column would it tell me how many courses are on that day so I can have the number of courses running as well as the number of people out of the office?
 
Upvote 0
you're welcome!

excel 2007

=countIFS(E7:E10,"<="&F4,F7:F10,">="&F4)

excel 2003

=count(IF(E7:E10<=F4,IF(F7:F10>=F4,1)))

for both formulas you do not need to reference the student count col.
 
Upvote 0
Thanks again, that's just the job ~ unless my boss changes her mind and wants something different!
 
Upvote 0

Forum statistics

Threads
1,224,517
Messages
6,179,233
Members
452,898
Latest member
Capolavoro009

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