statistical statement for the number of each employee

Mussa

Active Member
Joined
Jul 12, 2021
Messages
261
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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
@Peter_SSs sorry I come back again . I've found if I repeat days for the same employee it doesn't count repeted day .
for instance if I repeat SAT twice for employee 1 it shows 1 . should be 2 how can fix it,please?
 
Upvote 0
Could we have some sample data and expected results that show the new requirements to help with understanding?
 
Upvote 0
1 Microsoft Excel NN.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD
1daysdateemployee1employee2bra1bra2bra3bra4sel1sel2sel3sel4mrsrvectrsatsunmontuewedthufri
2sat1bra1sel1mrbra2sel1mremployee16100511061111111010
3sun2bra1sel1mrtrsel1employee20311410232131101101
4mon3bra1sel2mrvecemployee3                   
5tue4bra2sel3srbra2sel4sremployee4                   
6wed5vecbra4sel4mremployee5                   
7thu6bra1sel1mrtremployee6                   
8fri7trbra3sel2sremployee7                   
9sat1bra1sel1mrbra2sel1mr
10sun2bra1sel1mrtrsel1
ورقة1
Cell Formulas
RangeFormula
L2:W8L2=IFNA(COUNTIF(INDEX($C$2:$I$10,1,MATCH($K2,$C$1:$I$1,0)):INDEX($C$2:$I$10,ROWS($C$2:$I$10),MATCH($K2,$C$1:$I$1,0)+2),L$1),"")
X2:AD8X2=IFNA(--(INDEX($C$2:$I$10,MATCH(X$1,$A$2:$A$10,0),MATCH($K2,$C$1:$I$1,0)+1)&INDEX($C$2:$I$10,MATCH(X$1,$A$2:$A$10,0),MATCH($K2,$C$1:$I$1,0)+2)<>""),"")


the employee1 contains SAT twice as in A2,9 then should be in X2=2 not 1
also employee 2 contains sun twice as in A3,10 then should be in Y3=2 not 1
 
Upvote 0
What value here for employee1 for sat and please explain the result?

Mussa.xlsm
ABCDE
1daysdateemployee1
2sat1bra1
3sun2bra1sel1mr
4mon3bra1sel2mr
5tue4bra2sel3sr
6wed5vec
7thu6bra1sel1mr
8fri7tr
9sat1bra1sel1
10sun2bra1sel1mr
11mon3
12tue4
13wed5
14thu6
15fri7
16sat1bra4sel1mr
Sheet2 (2)
 
Upvote 0
based on column A and columns (D,E) together should be 2 . it ignores in row2 because columns D,E are empty .
the same thing about employee2 should ignore if the columns H,I are empty
11.PNG
 
Upvote 0
OK, see if this works for you.

Mussa.xlsm
ABCDEFGHIJKXYZAAABACAD
1daysdateemployee1employee2satsunmontuewedthufri
2sat1bra1sel1mrbra2sel1mremployee12111001
3sun2bra1sel1mrtrsel1employee21201100
4mon3bra1sel2mrvecemployee3       
5tue4bra2sel3srbra2sel4sremployee4       
6wed5vecbra4sel4mremployee5       
7thu6employee6       
8fri7abcxemployee7       
9sat8bra1sel1mrtr
10sun9trbra3sel2sr
Count per Employee (3)
Cell Formulas
RangeFormula
X2:AD8X2=IF(ISNUMBER(MATCH($K2,$C$1:$G$1,0)),(LEN(SUBSTITUTE(TEXTJOIN("|",0,IF($A$2:$A$10=X$1,IF($C$1:$G$1=$K2,$A$2:$A$10&$D$2:$H$10&$E$2:$I$10,""),"")),X$1&"||",""))-LEN(SUBSTITUTE(SUBSTITUTE(TEXTJOIN("|",0,IF($A$2:$A$10=X$1,IF($C$1:$G$1=$K2,$A$2:$A$10&$D$2:$H$10&$E$2:$I$10,""),"")),X$1&"||",""),X$1,"")))/3,"")
 
Upvote 0
it gives error #VALUE!
As you can see, it did not for me. :)

Perhaps you could post a small XL2BB sample that does produce an error?

BTW, it does require your Excel 2019 not Excel 2010
 
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,043
Members
452,542
Latest member
Bricklin

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