Formula to count how many cells have 2 diff variables

mmmsoupy

New Member
Joined
Dec 30, 2010
Messages
3
My work has a "Termination Report" where we keep track of how many employees quit/were fired for whatever reason. I'd like for the cells to automatically count this for me. This is how we have it set up:

CentralValleyTerms.jpg


The list of stores are in Column A on the left and the list of reasons are at the top in Row 2.

I've been keeping track of all terminated employees on the other sheet which looks like this:

Employees.jpg


On this sheet the E column contains the "Reason for termination" code

So using one cell as an example: on the "Central Valley" sheet C3 is the cell for how many terms from Arden Fair (Store #15) were because of unsatisfactory performance. I would want the formula to count how many times "15" appears in the B column (On the "Employees" worksheet) and "T01" appears in the E column at the same time. (T01 is the term code for "Unsatisfactory Performance")

I think I'll probably have to add in a column out of print range (or hidden) to put a "1" in each row so it has something to count... And that's fine.

I really hope this makes sense... because this is for the whole year and if I have to go back through and count each of these individually for all of 2011 through August, I think I may cry.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
If you have Excel 2007 or later, you could use the COUNTIFS function

=COUNTIFS(Employees!B:B, 15, Employees!E:E, "T03")


If you have Excel 2003 or earlier, use the SUMPRODUCT function.

=SUMPRODUCT(--(Employees!B2:B500=15),--(Employees!E2:E500="T03"))
 
Last edited:
Upvote 0
Thank you so much! Although if anyone else ever needs something like this I did have to modify the formula slightly.

<table width="33" border="0" cellpadding="0" cellspacing="0"><col width="33"><tbody><tr height="40"> <td class="xl22" style="height: 30pt; width: 25pt;" width="33" height="40">=SUMPRODUCT(--('Employees'!B3:B600=15),--('Employees'!E3:E600="T01"))</td></tr></tbody></table>
 
Upvote 0

Forum statistics

Threads
1,224,567
Messages
6,179,571
Members
452,927
Latest member
whitfieldcraig

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