Is Countifs right you use?

TSing3

Board Regular
Joined
Jan 7, 2015
Messages
54
I’m trying to return the number of times a name appears in a range of cells based on the criteria of another cell. In column AT I have names of departments: Safety, Quality, FI, etc. In columns AX:BG I have a bunch of people’s names.

On another sheet I’m trying to find how many times a name, Jack for example, appears in the table in the same row that Safety appears in AT. I’m basically trying to figure out how many safety projects each person is involved in.
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Maybe something like
=SUMPRODUCT((Sheet1!AX2:BG10="Jack")*(Sheet1!AT2:AT10="Safety"))
 
Upvote 0
If you have your data like this

Sheet1
<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:156.83px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >AT</td><td >AX</td><td >AY</td><td >AZ</td><td >BA</td><td >BB</td><td >BC</td><td >BD</td><td >BE</td><td >BF</td><td >BG</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Depts</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name1</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name2</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name3</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name4</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name5</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name6</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name7</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name8</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name9</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Name10</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td >Safety</td><td >Jack</td><td >Damor</td><td >Tsing</td><td >Jack</td><td >Damor</td><td >Jack</td><td >Jack</td><td >Jack</td><td >Tsing</td><td >Tsing</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td >Quality</td><td > </td><td >Damor</td><td > </td><td > </td><td >Damor</td><td > </td><td > </td><td > </td><td >Damor</td><td > </td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td >FI</td><td >Tsing</td><td >Tsing</td><td >Tsing</td><td >Tsing</td><td > </td><td > </td><td >Tsing</td><td >Tsing</td><td >Tsing</td><td >Tsing</td></tr></table>

Try

Sheet2
<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:78.89px;" /><col style="width:76.04px;" /><col style="width:76.04px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td><td >C</td><td >D</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td > </td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Safety</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">Quality</td><td style="background-color:#ffff00; font-weight:bold; text-align:center; ">FI</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td style="background-color:#92d050; ">Tsing</td><td style="text-align:right; ">3</td><td style="text-align:right; ">0</td><td style="text-align:right; ">8</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td style="background-color:#92d050; ">Jack</td><td style="text-align:right; ">5</td><td style="text-align:right; ">0</td><td style="text-align:right; ">0</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td style="background-color:#92d050; ">Damor</td><td style="text-align:right; ">2</td><td style="text-align:right; ">3</td><td style="text-align:right; ">0</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Array Formula</td></tr><tr><td >B2</td><td >{=COUNT(IF(Sheet1!$AT$2:$AT$4=B$1,IF(Sheet1!$AX$2:$BG$4=$A2,1)))}</td></tr></table></td></tr></table>

Array formulas
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself.
 
Upvote 0
I thought it worked because it returned 6 for someone that has been in 6, but it returns 6 for some people that haven’t been in 6.
 
Upvote 0
You can give examples of how you have the data.


If your data is as my example, the array formula is enter with shift + control + enter
 
Upvote 0
Using the example Dante supplied I get the correct answers for both formulae.


Book1
ABCDEFG
1SafetyQualityFISafetyQualityFI
2Tsing308308
3Jack500500
4Damor230230
Collated Data
Cell Formulas
RangeFormula
B2=SUMPRODUCT((Sheet1!$AX$2:$BG$10=$A2)*(Sheet1!$AT$2:$AT$10=B$1))
E2{=COUNT(IF(Sheet1!$AT$2:$AT$4=B$1,IF(Sheet1!$AX$2:$BG$4=$A2,1)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

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