statistical statement for the number of each employee

Mussa

Active Member
Joined
Jul 12, 2021
Messages
264
Office Version
  1. 2019
  2. 2010
hello
I would count containing for each employee based on matching columns with the headers .

orginal data
1.xlsx
ABCDEFGHIJKLMNOPQRSTUVW
2daysdateemployee1employee2bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectr
3sat1bra1sel1mrbra2sel1mremployee1
4sun2bra1sel1mrtrsel1employee2
5mon3bra1sel2mrvecemployee3
6tue4bra2sel3srbra2sel4sremployee4
7wed5vecbra4sel4mremployee5
8thu6bra1sel1mrtremployee6
9fri7trbra3sel2sremployee7
10employee8
s


result
1.xlsx
KLMNOPQRSTUVW
2bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectr
3employee1410031104111
4employee2021121022212
5employee3
6employee4
7employee5
8employee6
9employee7
10employee8
s
 

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
Try this

22 02 28.xlsm
ABCDEFGHIJKLMNOPQRSTUVW
1daysdateemployee1employee2bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectr
2sat1bra1sel1mrbra2sel1mremployee1410031104111
3sun2bra1sel1mrtrsel1employee2021121022212
4mon3bra1sel2mrvecemployee3            
5tue4bra2sel3srbra2sel4sremployee4            
6wed5vecbra4sel4mremployee5            
7thu6bra1sel1mrtremployee6            
8fri7trbra3sel2sremployee7            
9employee8            
Count per Employee
Cell Formulas
RangeFormula
L2:W9L2=IFNA(COUNTIF(INDEX($C$2:$I$8,1,MATCH($K2,$C$1:$I$1,0)):INDEX($C$2:$I$8,ROWS($C$2:$I$8),MATCH($K2,$C$1:$I$1,0)+2),L$1),"")
 
Upvote 0
Maybe this

Book1
KLMNOPQRSTUVW
1bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectr
2employee1410031104111
3employee2021121022212
4employee3
Sheet1
Cell Formulas
RangeFormula
L2:W3L2=SUMPRODUCT(($C$1:$I$1=$K2)*($C$2:$I$8=L$1))
 
Upvote 0
Maybe this

statistical statement for the number of each employee_Mussa.xlsx
ABCDEFGHI
1daysdateemployee1employee1employee1employee2employee2employee2
2sat1bra1sel1mrbra2sel1mr
3sun2bra1sel1mrtrsel1
4mon3bra1sel2mrvec
5tue4bra2sel3srbra2sel4sr
6wed5vecbra4sel4mr
7thu6bra1sel1mrtr
8fri7trbra3sel2sr
Sheet1


Book1
KLMNOPQRSTUVW
1bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectr
2employee141  311 4111
3employee2 21121 22212
4employee3
Sheet1
Cell Formulas
RangeFormula
L2:W3L2=SUMPRODUCT(($C$1:$I$1=$K2)*($C$2:$I$8=L$1))
 
Upvote 0
magnificent! thanks guys . how can I expand the formula to include the days
so when count the days for each employee should be zero if the cells in columns D ,I togheter and H,I together are empty
like this
collect column.xlsM
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1daysdateemployee1employee2bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectrsatsunmontuewedthufri
2sat1bra1sel1mrbra2sel1mremployee14100311041111111010
3sun2bra1sel1mrtrsel1employee20211210222121101101
4mon3bra1sel2mrvecemployee3            
5tue4bra2sel3srbra2sel4sremployee4            
6wed5vecbra4sel4mremployee5            
7thu6bra1sel1mrtremployee6            
8fri7trbra3sel2sremployee7            
summary
Cell Formulas
RangeFormula
L2:W8L2=IFNA(COUNTIF(INDEX($C$2:$I$8,1,MATCH($K2,$C$1:$I$1,0)):INDEX($C$2:$I$8,ROWS($C$2:$I$8),MATCH($K2,$C$1:$I$1,0)+2),L$1),"")
 
Upvote 0
how can I expand the formula to include the days
I wouldn't be expanding that formula since this is a very different question. I would use a separate formula for the days.

Mussa.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1daysdateemployee1employee2bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectrsatsunmontuewedthufri
2sat1bra1sel1mrbra2sel1mremployee14100311041111111010
3sun2bra1sel1mrtrsel1employee20211210222121101101
4mon3bra1sel2mrvecemployee3                   
5tue4bra2sel3srbra2sel4sremployee4                   
6wed5vecbra4sel4mremployee5                   
7thu6bra1sel1mrtremployee6                   
8fri7trbra3sel2sremployee7                   
Count per Employee (2)
Cell Formulas
RangeFormula
L2:W8L2=IFNA(COUNTIF(INDEX($C$2:$I$8,1,MATCH($K2,$C$1:$I$1,0)):INDEX($C$2:$I$8,ROWS($C$2:$I$8),MATCH($K2,$C$1:$I$1,0)+2),L$1),"")
X2:AD8X2=IFNA(--(INDEX($C$2:$I$8,MATCH(X$1,$A$2:$A$8,0),MATCH($K2,$C$1:$I$1,0)+1)&INDEX($C$2:$I$8,MATCH(X$1,$A$2:$A$8,0),MATCH($K2,$C$1:$I$1,0)+2)<>""),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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