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

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
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,216,377
Messages
6,130,261
Members
449,568
Latest member
mwl_y

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