Count the number of days since employee last day of recorded absence/tardy

nor1325

New Member
Joined
Aug 9, 2013
Messages
2
I am trying to get the correct formula to count the number of days it has been for each employee since the last occurrence of an absence/tardy. For each employee, starting with the beginning of the year, we mark and employee as Absent as an "A" or Tardy as "T". See below the examples.

[TABLE="width: 500"]
<tbody>[TR]
[TD][TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Employee Name[/TD]
[TD]Date:[/TD]
[TD]1/1[/TD]
[TD]1/2[/TD]
[TD]1/3[/TD]
[TD]1/4[/TD]
[TD]1/5[/TD]
[TD]1/6[/TD]
[TD]1/7[/TD]
[TD]1/8[/TD]
[TD]1/9[/TD]
[TD]1/10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Captain America[/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]T[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Incredible Hulk[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]T[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Spiderman[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Iron Man[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]A[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]



We are keeping track so that employees have the ability to make up numbers because after so many occurrences they can become terminated. If an employee has about 60 days in a row without an infraction, that employee can deduct a day from their total on the year.

If anyone could give me a formula to use that would be great. Also to include a vlookup so that I could have their name as well with the number of days on a separate tab!

Thank you!!
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Assuming that Sheet1!A1:L5 contains the data, first enter your names in Sheet2...

Sheet2!A2: Captain America

Sheet2!A3: Incredible Hulk

...and so on. Then enter the following formula in Sheet2!B2, and copy down:

=LOOKUP(2,1/ISNUMBER(MATCH(INDEX(Sheet1!$C$2:$L$5,MATCH(A2,Sheet1!$A$2:$A$5,0),0),{"A","T"},0)),Sheet1!$C$1:$L$1)

Adjust the ranges, accordingly. Actually, since you want to count the number of days since an employee's last absence or tardy, you probably want the following instead...

=TODAY()-LOOKUP(2,1/ISNUMBER(MATCH(INDEX(Sheet1!$C$2:$L$5,MATCH(A2,Sheet1!$A$2:$A$5,0),0),{"A","T"},0)),Sheet1!$C$1:$L$1)
 
Last edited:
Upvote 0
Adjust the ranges to cover all data YTD.
Excel Workbook
ABCDEFGHIJKLMN
1Employee NameDate:1-Jan2-Jan3-Jan4-Jan5-Jan6-Jan7-Jan8-Jan9-Jan10-JanDays since last A/T
2Captain AmericaAT214
3Incredible HulkT218
4SpidermanA212
5Iron ManA217
6Never Absent GuyNo A/T
Sheet5
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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