Forum Discussion
Leow Chee Voon
Sep 20, 2018Copper Contributor
What is the best way to count a set of data
Hello guys!
I encounter the following problem. I need to count number of occurrence of OFF, MC, AL and etc day for James, Jane and John for the set of date range. (as per sample data)
| Date | James | Jane | John |
| 21-Aug-18 | P | P | P |
| 22-Aug-18 | OFF | P | P |
| 23-Aug-18 | P | P | P |
| 24-Aug-18 | P | P | P |
| 25-Aug-18 | P | P | P |
| 26-Aug-18 | OFF | OFF | P |
| 27-Aug-18 | P | P | P |
| 28-Aug-18 | P | P | P |
| 29-Aug-18 | P | HD | P |
| 30-Aug-18 | P | P | P |
| 31-Aug-18 | OFF | OFF | P |
| 1-Sep-18 | P | MC | P |
| 2-Sep-18 | OFF | OFF | P |
| 3-Sep-18 | P | MC | P |
| 4-Sep-18 | P | P | P |
| 5-Sep-18 | P | P | P |
| 6-Sep-18 | P | P | P |
| 7-Sep-18 | P | P | P |
| 8-Sep-18 | P | P | P |
| 9-Sep-18 | OFF | OFF | P |
| 10-Sep-18 | OFF | OFF | P |
| 11-Sep-18 | P | LATE | P |
| 12-Sep-18 | P | P | P |
| 13-Sep-18 | P | LATE | P |
| 14-Sep-18 | P | P | P |
| 15-Sep-18 | P | P | P |
| 16-Sep-18 | P | OFF | P |
| 17-Sep-18 | P | OFF | P |
| 18-Sep-18 | P | P | AL |
| 19-Sep-18 | P | MC | P |
20-Sep-18
| P | P |
Need to summarize it as follows
| James | Jane | John | |
| OFF | 6 | 7 | 0 |
| UPL | |||
| AL | 1 | ||
| HD | 1 | ||
| MC | 3 | ||
| LATE | 2 | ||
| ABS |
What is the best way to do it? Appreciate your help!
3 Replies
- SergeiBaklanDiamond Contributor
Hi Leow,
For data as here
that could be
=COUNTIF(OFFSET($A$1,1,MATCH(G$1,$B$1:$D$1,0),COUNT($A$2:$A$1000)),$F2)
in G2, drag it down and to the right.
Attached
- Leow Chee VoonCopper ContributorDear Sergei,
Thanks for your tips. It works wonderfully!!- SergeiBaklanDiamond Contributor
Leow, your are welcome