简体   繁体   中英

Count number of rows in which value occurs in any column

Sample Data:

在此处输入图像描述

Desired result:

Name       Number Handled
Bill       1
Erica      1
James      2
Jimmy      1
John       1
Kory       1

Setup:

Column W is "Incident Number", Column X is "Created by", Column Y is "Resolved By", and Column Z is "Updated By". The same person can create, resolve and update or can be multiple people. The boss is asking for each person in the team, how many tickets are they touching each day. So if "James" is opened, resolved, and updated ticket 22, he did one ticket. If James opened ticket 22 but Tony resolved it, they each touched ticket 22 so both get credit. Same with Updated. Could be same person, or 3 different. For each tech I need a formula to find the total number of tickets they touched, regardless of how many actions they did on the ticket.

Add another column (I used AA) that concatenates the three columns. You'll need to replace "Sheet1" with whatever the sheet name is

=CONCATENATE(",",Sheet1!X1,",",Sheet1!Y1,",",Sheet1!Z1,",")

Then your formula is a simple countif with search

=COUNTIF(AA:AA,"*,"&A2&",*")

You can use either of the following formulas to get the result (assuming your names are in column A of another sheet. Use the first formula if calculation speed isn't an issue and your number of rows varies a lot. Use the second formula for faster calculation if you can be confident that the number of rows won't go above some number. Just replace 1000 with your own number.

=SUMPRODUCT(SIGN((Sheet1!$X:$X=$A2)+(Sheet1!$Y:$Y=$A2)+(Sheet1!$Z:$Z=$A2)))
=SUMPRODUCT(SIGN((Sheet1!$X$2:$X$1000=$A2)+(Sheet1!$Y$2:$Y$1000=$A2)+(Sheet1!$Z$2:$Z$1000=$A2)))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM