counting dependent on date and department

ljvb

New Member
Joined
Jul 1, 2002
Messages
22
I have a detail table that shows monthly salaries by month across the top and individual staff members with department down the side . I'm creating a summary table that counts the number of staff in a table by date across the top and department down the side (salary greater than zero).

I've done it to show total salaries by month and deparment using sumif and the index/match combination to set the column (see below for sample) but sadly countif doesn't have the same parameters as sumif.

=SUMIF(StaffDetail!$A$5:$A$103,$A14,INDEX(StaffDetail!$I$5:$BD$5,MATCH(B$13,StaffDetail!$I$1:$BD$1,0)))

Thoughts on how to handle this?
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Hi, it's a little difficult to visualise your set-up - but based on the SUMIF() maybe this is what you want:

=COUNTIFS(StaffDetail!$A$5:$A$103,$A14,INDEX(StaffDetail!$I$5:$BD$5,MATCH(B$13,StaffDetail!$I$1:$BD$1,0)),">0")
 
Upvote 0
Hi, actually - I think this is it, COUNTIFS() does not automatically adjust the ranges if they are not the same size like SUMIF().

=COUNTIFS(StaffDetail!$A$5:$A$103,$A14,INDEX(StaffDetail!$I$5:$BD$103,0,MATCH(B$13,StaffDetail!$I$1:$BD$1,0)),">0")
 
Upvote 0
That's it, thank you! Bit of a tricky one to wrap my head around. Appreciate your help
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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