Counting Cells based on separate column with Index/Match

excelmag

New Member
Joined
Feb 14, 2018
Messages
6
I have a table that has group/division names, employee names, and then tracking an attendance measure for multiple days throughout the year. I'm trying to create a table at the top so that division leads can type in the day and see how many people they had check in that day. Checkins start with numbers (only important because if someone calls in sick, they will be listed as "sick," "vacation," etc. and not start with a number).
I've been trying to build a formula (Excel 2010) for each of the groups, but am having problems merging it with the countif function
So far, I have =countif(index(J8:AN108,0,MATCH(J4,J7:AN7,0)))
the problem being that it counts all the attendees for the day and I haven't been able to figure out how to get it to count each group separately based on the group name in column B.

Anyone have suggestions?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="width: 866"]
<colgroup><col><col span="2"><col><col span="3"><col><col span="4"><col><col><col><col span="4"></colgroup><tbody>[TR]
[TD]MOCK UP TABLE[/TD]
[TD](bold is where[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 9"][/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] the formulas[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Date[/TD]
[TD]Diamond[/TD]
[TD]Emerald[/TD]
[TD]Amethyst[/TD]
[TD="colspan: 3"]Ruby[/TD]
[TD]Sapphire[/TD]
[TD]Total[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] should go)[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]3-Jan[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD="colspan: 3"]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD] [/TD]
[TD] [/TD]
[/T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D]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Hi,

A bit confused about the usage of index/match within countif.
If you want to count items based on multiple criteria (as that's what your aiming for) take a look at COUNTIFS.
Share a mockup of data and your draft report and we can help somewhat extensive.
 
Upvote 0
So sorry, I thought I had attached a mockup!
The 0s are where I've been trying to insert the formula (obviously I would adjust the formula for the Emerald division to be column K, Amethyst to be column L, etc.)





[TABLE="width: 866"]
<colgroup><col><col span="2"><col><col span="3"><col><col span="4"><col><col><col><col span="4"></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD="colspan: 9"]Census[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Date[/TD]
[TD]Dz[/TD]
[TD]Ez[/TD]
[TD]Az[/TD]
[TD="colspan: 3"]Rz[/TD]
[TD]Sz[/TD]
[TD]Total[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]3-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D][/TD]
[TD][/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Due to your newness and the presented data the system auto-moderated your later posts
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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