Countif staff name if date in range

Aussie Grid

New Member
Joined
Jan 14, 2010
Messages
47
Hi all, on a staff roster I would like to get a count of the shifts per individual for the pay period. Eg. If the pay period is 1/6/10 to 10/6/10 how many shifts is Allira working?
B & C are filled down from a master date & then formated "ddd" & "d". ie B1=A1, B2=B1+1, B3=B2+1 etc. Same for column C.
I need the name to refer back to the staff names range so that any future staff changes don't require a change of formula/ code etc.
Dates are set up this way so that 1 click can change the master date at the start of a new year and weekends etc are auto highlighted via con formating.

Any & all help appreciated
Aussie Grid
B C D
Fri 1 CAROLE
Sat 2 ALLIRA
Sun 3 ALLIRA
Mon 4 GLENIS
Tue 5 ALLIRA
Wed 6 GLENIS
Thu 7 JOSIE
Fri 8 GLENIS
Sat 9 ALLIRA
Sun 10 NATALEE
Mon 11 CAROLE
Tue 12 NATALEE
Wed 13 GLENIS
Thu 14 DANIEL
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Try

=SUMPRODUCT(--($B$2:$B$20>=--"2010-06-01"),--($B$2:$B$20<=--"2010-06-10"),--($D$2:$D$20>="ALLIRA"))
 
Upvote 0
For Excel 2007+ I would use the formula in I2, otherwise I3.

Excel Workbook
ABCDEFGHIJ
101/06/2010Tue1CAROLEStartEndNameShifts
2Wed2ALLIRA01/06/201010/06/2010Allira4Excel 2007+
3Thu3ALLIRA4Excel 2003-
4Fri4GLENIS
5Sat5ALLIRA
6Sun6GLENIS
7Mon7JOSIE
8Tue8GLENIS
9Wed9ALLIRA
10Thu10NATALEE
11Fri11CAROLE
12Sat12NATALEE
13Sun13GLENIS
14Mon14DANIEL
15
Shift Count
 
Upvote 0
Grateful thanks to you both for your speedy replies, but the cigar goes to Peter as I'm running 2007, which I should have mentioned.

Again thank you for your assistance.

Aussie Grid
 
Upvote 0
rather than start a new thread as this is so closely related to my problem, whats the best way in 2007 to specify just a month and year i.e. May 2010 rather than a start and end date.. In 2003 i used sum product and TEXT "mmm" but i want to revamp my dashboard in 2007 as the countifs and averageifs functions are so simple to use
 
Upvote 0
rather than start a new thread as this is so closely related to my problem, whats the best way in 2007 to specify just a month and year i.e. May 2010 rather than a start and end date.. In 2003 i used sum product and TEXT "mmm" but i want to revamp my dashboard in 2007 as the countifs and averageifs functions are so simple to use
Depends a bit how your month and year of interest are specified, but I suspect your existing SUMPRODUCT formula is something like H2, which is considerably simpler than the COUNTIFS in H3.

If this doesn't match what your sheet is like or what you are trying to do, please provide a small set of sample data and the expected result.

Excel Workbook
BCDEFGH
105/10/2008CAROLEMonthYearNameCount
212/10/2008ALLIRANov2008Allira2
319/10/2008ALLIRA2
426/10/2008GLENIS
502/11/2008ALLIRA
609/11/2008GLENIS
716/11/2008JOSIE
823/11/2008GLENIS
930/11/2008ALLIRA
1007/12/2008NATALEE
1114/12/2008CAROLE
1221/12/2008ALLIRA
1328/12/2008GLENIS
1404/01/2009ALLIRA
15
Count within Year
 
Upvote 0
rather than start a new thread as this is so closely related to my problem, whats the best way in 2007 to specify just a month and year i.e. May 2010 rather than a start and end date.. In 2003 i used sum product and TEXT "mmm" but i want to revamp my dashboard in 2007 as the countifs and averageifs functions are so simple to use

Maybe, but they are limited you cannot include range expressions, so continue with SUMPRODUCT.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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