Expiration date formula in large spreadsheet; avoiding Data Model

pam5cashfan

New Member
Joined
Dec 31, 2018
Messages
5
Hello all. I have a fairly large data set (30,000 lines -will grow to 50,000) which is a set of employee payroll records.

I am hoping to identify a particular type of rule violation - when a worker who has worked both as a "Temp" and as a "Part-Time" has worked hours in violation of the rule that a person is limited to working as a Temp for no more than 14 weeks after the first week in which he/she worked as a Temp.

It is allowable to work for more than 14 weeks if you are a part-time worker.

The output in the "MayBeTempViolation" correctly identifies a violation for Temp workers - but it also incorrectly describes as a "Yes" violation a worker who started off as a Temp, and then ended up as a Part-Time worker more than 14 weeks after the first week worked.

I'd prefer to use a formula that accounts for this employee-category switching. Currently, I pull this data into a Pivot Table and add VLookup to display Violation Type, and then drill down into the data to flag violations that aren't really violations,and then manually delete them. Last month, the formula flagged hundreds of Temp violations that weren't really violations.

I can't use VBA or array formulas. I don't format the data as a Table or use the Data Modeling features (Distinct Count) because my experience is the file becomes large and unstable. And others in my organization with basic Excel skills need to be able to use the spreadsheet.

Thanks!!

ABCDEF
1IDNumberStatusWeek-EndHours WorkedMinPay-EndMayBeTempViolation?
22344Part-Time3/9/2019503/09/19No
32344Temp3/16/20191503/09/19No
42344Part-Time3/23/2019503/09/19No
52344Part-Time3/30/2019503/09/19No
67281Temp3/16/20193503/16/19No
77281Temp3/30/20193503/16/19No
87281Part-Time7/1/20191403/16/19Yes
97281Temp7/1/20192503/16/19Yes

<tbody>
</tbody>
Sheet2

Worksheet Formulas
CellFormula
E2=MINIFS(C:C,A:A,A2)
F2=(IF($C2>($E2+14*7),"Yes","No"))
E3=MINIFS(C:C,A:A,A3)
F3=(IF($C3>($E3+14*7),"Yes","No"))
E4=MINIFS(C:C,A:A,A4)
F4=(IF($C4>($E4+14*7),"Yes","No"))
E5=MINIFS(C:C,A:A,A5)
F5=(IF($C5>($E5+14*7),"Yes","No"))
E6=MINIFS(C:C,A:A,A6)
F6=(IF($C6>($E6+14*7),"Yes","No"))
E7=MINIFS(C:C,A:A,A7)
F7=(IF($C7>($E7+14*7),"Yes","No"))
E8=MINIFS(C:C,A:A,A8)
F8=(IF($C8>($E8+14*7),"Yes","No"))
E9=MINIFS(C:C,A:A,A9)
F9=(IF($C9>($E9+14*7),"Yes","No"))

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi pam5cashfan,

so your rules are:
-a worker has worked both as a Temp and as a Part-Time
-there cannot be more than 14 weeks between the min & max date of Temp work

what if you change your formulas to something like this:
E2 =MINIFS(C:C,A:A,A2,B:B,"Temp")
F2 =IF(COUNTIFS(A:A,A2)=COUNTIFS(A:A,A2,B:B,B2),B2 & " only","both types")
G2 =(AND(IF($C2>($E2+14*7),$B2="Temp",$F2="both types"),"Yes","No"))
That removes a bunch of false positives as you only focus on the Temp category.

Cheers,
Koen
 
Upvote 0
Thank you very much Koen - extremely helpful. I realized that the switching between employee types was not really my problem - rather, I hadn't used MINIFS and MAXIFS to identify hours worked *as a Temp*, which your formula shows. So I used your E2 formula and added a column for a MAXIFS version of that formula. Now I can flag any Temp who worked more than 14 weeks by comparing the two dates.

Thanks again!
Pam
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,696
Members
449,048
Latest member
81jamesacct

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