Absent Counts Based on Attendance

LOK25

New Member
Joined
Apr 24, 2021
Messages
3
Office Version
  1. 2016
  2. 2013
  3. 2010
Platform
  1. Windows
Hi folks,

I wanted to thank you all in advance for any assistance you may provide. My issue doesn't seem really difficult, but I've been agonizing over this for hours :cry:.

Essentially, in addition to the working formula in Cell F2, i realized that i need to perform the same calculation, but based on finding the employee name in Column A.

For example, there are multiple employees in Column A (John Doe and Jane Smith), i need the formula which worked when only one name was present to find all hits of "John Doe" in Column A (A2:A18) then perform the same calculation found in Cell F2 just based on name in column A. Then i could perform the same calculation, but for "Jane Smith" and any other names i add to Column A.

So its a simple count and my correct manual answers are:

-John Doe was absent 5 days and had 6 absent occurrences.
-Jane Smith was absent 4 days and had 5 absent occurrences.

I included the spreadsheet with the previous working solution in Cell F2 when only one employee was involved, but again when i added another employee and expanded the formulas the absences calculation isn't right.

Any help is appreciated.

Updated.xlsx
ABCDEF
1EmployeeDateHours TypeCodeAbsent Calculation (Working)Absences Formula #1
2John Doe2/1/2021LA#absent5
3John Doe2/2/2021RFTSabsent
4John Doe2/3/2021RF# 
5John Doe2/4/2021RFTSabsent
6John Doe2/4/2021LS#absent
7John Doe2/8/2021RFTSabsent
8John Doe2/9/2021RF# 
9John Doe2/10/2021OS#absent
10Jane Smith2/1/2021RF# 
11Jane Smith2/2/2021RF# 
12Jane Smith2/3/2021RF# 
13Jane Smith2/4/2021RFTSabsent
14Jane Smith2/4/2021LS#absent
15Jane Smith2/8/2021RFTSabsent
16Jane Smith2/9/2021RFTSabsent
17Jane Smith2/10/2021RF# 
18Jane Smith2/11/2021OS#absent
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT((IF($E$2:$E$9="absent",1/COUNTIF($B$2:$B$9,$B$2:$B$9),"")))
E2:E18E2=IF(OR(LEFT(C2)<>"R",AND(LEFT(C2)="R",LEFT(D2)="T")),"absent","")
Press CTRL+SHIFT+ENTER to enter array formulas.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
How about
+Fluff 1.xlsm
ABCDEF
1EmployeeDateHours TypeCodeAbsent Calculation (Working)Absences Formula #1
2John Doe02/01/2021LA#absent5
3John Doe02/02/2021RFTSabsent
4John Doe02/03/2021RF# 
5John Doe02/04/2021RFTSabsent
6John Doe02/04/2021LS#absent
7John Doe02/08/2021RFTSabsent
8John Doe02/09/2021RF# 
9John Doe02/10/2021OS#absent
10Jane Smith02/01/2021RF# 4
11Jane Smith02/02/2021RF# 
12Jane Smith02/03/2021RF# 
13Jane Smith02/04/2021RFTSabsent
14Jane Smith02/04/2021LS#absent
15Jane Smith02/08/2021RFTSabsent
16Jane Smith02/09/2021RFTSabsent
17Jane Smith02/10/2021RF# 
18Jane Smith02/11/2021OS#absent
Result
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT((IF((A2:A18=A2)*($E$2:$E$18="absent"),1/COUNTIFS(A2:A18,A2,$B$2:$B$18,$B$2:$B$18),"")))
F10F10=SUMPRODUCT((IF((A2:A18=A10)*($E$2:$E$18="absent"),1/COUNTIFS(A2:A18,A10,$B$2:$B$18,$B$2:$B$18),"")))
E2:E18E2=IF(OR(LEFT(C2)<>"R",AND(LEFT(C2)="R",LEFT(D2)="T")),"absent","")
 
Upvote 0
How about
+Fluff 1.xlsm
ABCDEF
1EmployeeDateHours TypeCodeAbsent Calculation (Working)Absences Formula #1
2John Doe02/01/2021LA#absent5
3John Doe02/02/2021RFTSabsent
4John Doe02/03/2021RF# 
5John Doe02/04/2021RFTSabsent
6John Doe02/04/2021LS#absent
7John Doe02/08/2021RFTSabsent
8John Doe02/09/2021RF# 
9John Doe02/10/2021OS#absent
10Jane Smith02/01/2021RF# 4
11Jane Smith02/02/2021RF# 
12Jane Smith02/03/2021RF# 
13Jane Smith02/04/2021RFTSabsent
14Jane Smith02/04/2021LS#absent
15Jane Smith02/08/2021RFTSabsent
16Jane Smith02/09/2021RFTSabsent
17Jane Smith02/10/2021RF# 
18Jane Smith02/11/2021OS#absent
Result
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT((IF((A2:A18=A2)*($E$2:$E$18="absent"),1/COUNTIFS(A2:A18,A2,$B$2:$B$18,$B$2:$B$18),"")))
F10F10=SUMPRODUCT((IF((A2:A18=A10)*($E$2:$E$18="absent"),1/COUNTIFS(A2:A18,A10,$B$2:$B$18,$B$2:$B$18),"")))
E2:E18E2=IF(OR(LEFT(C2)<>"R",AND(LEFT(C2)="R",LEFT(D2)="T")),"absent","")
Fluff,

Thanks but i found one issue when making a change that i was hoping you could help.

Please notice in Row 5 when i change Code (Column D) from "TS" to "#" which turned "absent" to blank (Column E), this is all correct. However, then the formula in F2 turns to 4.5 absences. Since the employee is still absent for 2/4/2021 this should still show a result of "5" since i cannot have half (.5) of an absence.

I included another snippet below showing the change, thank you so much!

Updated.xlsx
ABCDEF
1EmployeeDateHours TypeCodeAbsent Calculation (Working)Absences Formula-John doe
2John Doe2/1/2021LA#absent4.5
3John Doe2/2/2021RFTSabsent
4John Doe2/3/2021RF# 
5John Doe2/4/2021RF# 
6John Doe2/4/2021LS#absent
7John Doe2/8/2021RFTSabsent
8John Doe2/9/2021RF# 
9John Doe2/10/2021OS#absent
Sheet1
Cell Formulas
RangeFormula
F2F2=SUMPRODUCT((IF(($A$2:$A$18=A2)*($E$2:$E$18="absent"),1/COUNTIFS($A$2:$A$18,A2,$B$2:$B$18,$B$2:$B$18),"")))
E2E2=IF(OR(LEFT(C2)<>"R*",AND(LEFT(C2)="R*",LEFT(D2)="T*")),"absent","")
E3:E9E3=IF(OR(LEFT(C3)<>"R",AND(LEFT(C3)="R",LEFT(D3)="T")),"absent","")
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Ok, how about
Excel Formula:
=SUMPRODUCT((IF((A2:A18=A2)*($E$2:$E$18="absent"),1/COUNTIFS(A2:A18,A2,E2:E18,"absent",$B$2:$B$18,$B$2:$B$18),"")))
 
Upvote 0
Solution
Ok, how about
Excel Formula:
=SUMPRODUCT((IF((A2:A18=A2)*($E$2:$E$18="absent"),1/COUNTIFS(A2:A18,A2,E2:E18,"absent",$B$2:$B$18,$B$2:$B$18),"")))
Fluff,

Thanks so much that last post appeared to work.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,690
Members
449,117
Latest member
Aaagu

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