Monthly salary schedule using start date and termination date to populate

Tigvee

New Member
Joined
Mar 19, 2015
Messages
11
I have spent a significant amount of hours over the past couple months refining an equation. I'm 95% there but I ran into an issue I can't seem to fix.
Although I have searched the internet a bit for guidance, I have resisted at posting a thread here in hopes I could figure this out on my own.
I haven't been able to do it so I have prepared myself to be humbled since the gods at MrExcel most likely have an answer that will take them all of 2 mins to type.

The challenge:
1. To populate salary in a monthly schedule using employee start date and end date to drive the automated update of the table
a. Salary is paid 2x/month (15th & last day)
b. Once the start date is entered, the monthly salary can be inputted indefinitely
c. Once a termination date is entered, the salary doesn't populate past that month

Not too bad so far... but here are the hurdles:
1. If the start date or term date falls on a date that isn't exactly the start of the month, to calculate the prorated salary based on the number of business days worked thus far in the month
2. MY BUG -- The equation below works fine until you enter the last business day of the month
a. For example, 2/27 is the last business day in Feb 2015. However, the calculation will only start populating on 1st business day of March while there should be a workday rate for 1 day in Feb.

Current equation to this point:

Note I'm not married to this equation, it just kept building on itself until it became the monstrosity you see before you so if you have alternative solution, I'm open to suggestions...

=IF((IF($AB24="",MAX(((-NETWORKDAYS(BL$20,MAX(BK$20,$AA24)))-SIGN(-NETWORKDAYS(BL$20,MAX(BK$20,$AA24)))),0),MIN(MAX(((-NETWORKDAYS(BL$20,MAX(BK$20,$AA24)))-SIGN(-NETWORKDAYS(BL$20,MAX(BK$20,$AA24)))),0),MAX(MIN(((-NETWORKDAYS($AB24,BK$20))-SIGN(-NETWORKDAYS($AB24,BK$20))),((-NETWORKDAYS(BL$20,BK$20))-SIGN(-NETWORKDAYS($AB24,BK$20)))),0))))=((-NETWORKDAYS(BL$20,BK$20))-SIGN(-NETWORKDAYS(BL$20,BK$20))),$AD24/12,(IF($AB24="",MAX(((-NETWORKDAYS(BL$20,(MAX(BK$20,$AA24))))-SIGN(-NETWORKDAYS(BL$20,(MAX(BK$20,$AA24))))),0),MIN(MAX((-NETWORKDAYS(BL$20,(MAX(BK$20,$AA24))))-SIGN(-NETWORKDAYS(BL$20,(MAX(BK$20,$AA24)))),0),MAX(MIN(((-NETWORKDAYS($AB24,BK$20))-SIGN(-NETWORKDAYS($AB24,BK$20))),((-NETWORKDAYS(BL$20,BK$20)))-SIGN(-NETWORKDAYS(BL$20,BK$20))),0))))*$AO24)

Key:
AA24 = Start Date
AB24 = Term Date
AD24 = Annual Salary
AO24 = Workday Rate
BL20 = 1/31/2015
BK20 = 12/31/2014

Example:
Annual Salary Start End Dec Jan Feb Mar
Joe Blow 48000 1/1/15 (blank) 4000 4000 4000 and so on into the future
Jane Row 96000 2/27/15 (blank) calc 1 day 8000
Jeff Tow 24000 12/26/14 3/24/15 calc 4 days 2000 2000 calc 17 days
(since holidays are paid)

Thank you in advance for your help on this one... and a special thanks for always being the best resource out there for any excel related queries I can think of on any given day!
The contribution on this forum has saved me countless hours of work!
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I think most would agree that we might be better able to help if you post some sample data (which you can do by following the link in my signature below).

I will say that whenever I see a formula with a dozen nested function statements I tend to believe there is a more fathomable and efficient method.
 
Upvote 0

Excel 2012
LRXYZAAABACADAEBJBKBLBMBNBOBPBQ
5Annual Hrs
62,079.84
19ADPADPADPADPADPADPADPADPADPADPDec-14Jan-15Feb-15Mar-15Apr-15May-15Jun-15Jul-15
20Payroll NameEmp TypeHire DatePosition StatusPosition Start DateTermination DateRehire DateAnnual SalaryRegular Pay Rate AmountRate 2 (Hourly)12/31/20141/31/20152/28/20153/31/20154/30/20155/31/20156/30/20157/31/2015
21last, first1FT07/08/13Active07/08/1364,0002,66730.775,333.345,333.345,333.345,333.345,333.345,333.345,333.34
22last, first2FT02/09/15Terminated02/09/1507/31/1530,5001,27114.66--2,541.682,541.682,541.682,541.682,541.68
23last, first3FT12/29/08Active12/29/0877,5003,22937.266,458.346,458.346,458.346,458.346,458.346,458.346,458.34
24last, first4FT11/03/08Active11/03/0848,0402,00223.104,003.324,003.324,003.324,003.324,003.324,003.324,003.32
25last, first5PT02/09/15Terminated02/09/1507/31/1522,53410--1,877.851,877.851,877.851,877.851,877.85
26last, first6FT10/19/05Active10/19/0573,5003,06335.346,125.006,125.006,125.006,125.006,125.006,125.006,125.00
27last, first7FT02/14/11Active02/14/1198,8004,11747.508,233.348,233.348,233.348,233.348,233.348,233.348,233.34
28last, first8FT10/21/13Active10/21/1381,2003,38339.046,766.686,766.686,766.686,766.686,766.686,766.686,766.68
29last, first9FT08/17/09Active08/17/0947,5001,97922.843,958.323,958.323,958.323,958.323,958.323,958.323,958.32
30last, first10FT04/19/10Active04/19/1074,3503,09835.756,195.846,195.846,195.846,195.846,195.846,195.846,195.84
31last, first11FT03/09/15Active03/09/1555,0002,29226.44---4,583.324,583.324,583.324,583.32
32last, first12FT04/27/15Active04/27/1565,0002,70831.25----5,416.665,416.665,416.66
33last, first13FT11/01/10Active11/01/1080,0003,33338.466,666.666,666.666,666.666,666.666,666.666,666.666,666.66
34last, first14PT10/21/13Terminated10/21/1306/04/1533,801152,816.782,816.782,816.782,816.782,816.78--
35last, first15FT06/29/15Active06/29/1570,0002,91733.66------5,833.32
36last, first16FT10/04/10Active10/04/1048,5002,02123.324,041.664,041.664,041.664,041.664,041.664,041.664,041.66
Current Emp
 
Upvote 0

Excel 2012
LRXYZAAABACADAEBJBKBLBMBNBOBPBQ
34last, first14PT10/21/13Terminated10/21/1306/04/1533,801152,816.782,816.782,816.782,816.782,816.78--
Current Emp
Cell Formulas
RangeFormula
BK34=IF((IF($AA34="",MAX(((-NETWORKDAYS(BK$20,MAX(BJ$20,$Z34)))-SIGN(-NETWORKDAYS(BK$20,MAX(BJ$20,$Z34)))),0),MIN(MAX(((-NETWORKDAYS(BK$20,MAX(BJ$20,$Z34)))-SIGN(-NETWORKDAYS(BK$20,MAX(BJ$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BJ$20))-SIGN(-NETWORKDAYS($AA34,BJ$20))),((-NETWORKDAYS(BK$20,BJ$20))-SIGN(-NETWORKDAYS($AA34,BJ$20)))),0))))=((-NETWORKDAYS(BK$20,BJ$20))-SIGN(-NETWORKDAYS(BK$20,BJ$20))),$AC34/12,(IF($AA34="",MAX(((-NETWORKDAYS(BK$20,(MAX(BJ$20,$Z34))))-SIGN(-NETWORKDAYS(BK$20,(MAX(BJ$20,$Z34))))),0),MIN(MAX((-NETWORKDAYS(BK$20,(MAX(BJ$20,$Z34))))-SIGN(-NETWORKDAYS(BK$20,(MAX(BJ$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BJ$20))),((-NETWORKDAYS(BK$20,BJ$20)))-SIGN(-NETWORKDAYS(BK$20,BJ$20))),0))))*$AN34)
BL34=IF((IF($AA34="",MAX(((-NETWORKDAYS(BL$20,MAX(BK$20,$Z34)))-SIGN(-NETWORKDAYS(BL$20,MAX(BK$20,$Z34)))),0),MIN(MAX(((-NETWORKDAYS(BL$20,MAX(BK$20,$Z34)))-SIGN(-NETWORKDAYS(BL$20,MAX(BK$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BK$20))-SIGN(-NETWORKDAYS($AA34,BK$20))),((-NETWORKDAYS(BL$20,BK$20))-SIGN(-NETWORKDAYS($AA34,BK$20)))),0))))=((-NETWORKDAYS(BL$20,BK$20))-SIGN(-NETWORKDAYS(BL$20,BK$20))),$AC34/12,(IF($AA34="",MAX(((-NETWORKDAYS(BL$20,(MAX(BK$20,$Z34))))-SIGN(-NETWORKDAYS(BL$20,(MAX(BK$20,$Z34))))),0),MIN(MAX((-NETWORKDAYS(BL$20,(MAX(BK$20,$Z34))))-SIGN(-NETWORKDAYS(BL$20,(MAX(BK$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BK$20))),((-NETWORKDAYS(BL$20,BK$20)))-SIGN(-NETWORKDAYS(BL$20,BK$20))),0))))*$AN34)
BM34=IF((IF($AA34="",MAX(((-NETWORKDAYS(BM$20,MAX(BL$20,$Z34)))-SIGN(-NETWORKDAYS(BM$20,MAX(BL$20,$Z34)))),0),MIN(MAX(((-NETWORKDAYS(BM$20,MAX(BL$20,$Z34)))-SIGN(-NETWORKDAYS(BM$20,MAX(BL$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BL$20))-SIGN(-NETWORKDAYS($AA34,BL$20))),((-NETWORKDAYS(BM$20,BL$20))-SIGN(-NETWORKDAYS($AA34,BL$20)))),0))))=((-NETWORKDAYS(BM$20,BL$20))-SIGN(-NETWORKDAYS(BM$20,BL$20))),$AC34/12,(IF($AA34="",MAX(((-NETWORKDAYS(BM$20,(MAX(BL$20,$Z34))))-SIGN(-NETWORKDAYS(BM$20,(MAX(BL$20,$Z34))))),0),MIN(MAX((-NETWORKDAYS(BM$20,(MAX(BL$20,$Z34))))-SIGN(-NETWORKDAYS(BM$20,(MAX(BL$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BL$20))),((-NETWORKDAYS(BM$20,BL$20)))-SIGN(-NETWORKDAYS(BM$20,BL$20))),0))))*$AN34)
BN34=IF((IF($AA34="",MAX(((-NETWORKDAYS(BN$20,MAX(BM$20,$Z34)))-SIGN(-NETWORKDAYS(BN$20,MAX(BM$20,$Z34)))),0),MIN(MAX(((-NETWORKDAYS(BN$20,MAX(BM$20,$Z34)))-SIGN(-NETWORKDAYS(BN$20,MAX(BM$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BM$20))-SIGN(-NETWORKDAYS($AA34,BM$20))),((-NETWORKDAYS(BN$20,BM$20))-SIGN(-NETWORKDAYS($AA34,BM$20)))),0))))=((-NETWORKDAYS(BN$20,BM$20))-SIGN(-NETWORKDAYS(BN$20,BM$20))),$AC34/12,(IF($AA34="",MAX(((-NETWORKDAYS(BN$20,(MAX(BM$20,$Z34))))-SIGN(-NETWORKDAYS(BN$20,(MAX(BM$20,$Z34))))),0),MIN(MAX((-NETWORKDAYS(BN$20,(MAX(BM$20,$Z34))))-SIGN(-NETWORKDAYS(BN$20,(MAX(BM$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BM$20))),((-NETWORKDAYS(BN$20,BM$20)))-SIGN(-NETWORKDAYS(BN$20,BM$20))),0))))*$AN34)
BO34=IF((IF($AA34="",MAX(((-NETWORKDAYS(BO$20,MAX(BN$20,$Z34)))-SIGN(-NETWORKDAYS(BO$20,MAX(BN$20,$Z34)))),0),MIN(MAX(((-NETWORKDAYS(BO$20,MAX(BN$20,$Z34)))-SIGN(-NETWORKDAYS(BO$20,MAX(BN$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BN$20))-SIGN(-NETWORKDAYS($AA34,BN$20))),((-NETWORKDAYS(BO$20,BN$20))-SIGN(-NETWORKDAYS($AA34,BN$20)))),0))))=((-NETWORKDAYS(BO$20,BN$20))-SIGN(-NETWORKDAYS(BO$20,BN$20))),$AC34/12,(IF($AA34="",MAX(((-NETWORKDAYS(BO$20,(MAX(BN$20,$Z34))))-SIGN(-NETWORKDAYS(BO$20,(MAX(BN$20,$Z34))))),0),MIN(MAX((-NETWORKDAYS(BO$20,(MAX(BN$20,$Z34))))-SIGN(-NETWORKDAYS(BO$20,(MAX(BN$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BN$20))),((-NETWORKDAYS(BO$20,BN$20)))-SIGN(-NETWORKDAYS(BO$20,BN$20))),0))))*$AN34)
BP34=IF((IF($AA34="",MAX(((-NETWORKDAYS(BP$20,MAX(BO$20,$Z34)))-SIGN(-NETWORKDAYS(BP$20,MAX(BO$20,$Z34)))),0),MIN(MAX(((-NETWORKDAYS(BP$20,MAX(BO$20,$Z34)))-SIGN(-NETWORKDAYS(BP$20,MAX(BO$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BO$20))-SIGN(-NETWORKDAYS($AA34,BO$20))),((-NETWORKDAYS(BP$20,BO$20))-SIGN(-NETWORKDAYS($AA34,BO$20)))),0))))=((-NETWORKDAYS(BP$20,BO$20))-SIGN(-NETWORKDAYS(BP$20,BO$20))),$AC34/12,(IF($AA34="",MAX(((-NETWORKDAYS(BP$20,(MAX(BO$20,$Z34))))-SIGN(-NETWORKDAYS(BP$20,(MAX(BO$20,$Z34))))),0),MIN(MAX((-NETWORKDAYS(BP$20,(MAX(BO$20,$Z34))))-SIGN(-NETWORKDAYS(BP$20,(MAX(BO$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BO$20))),((-NETWORKDAYS(BP$20,BO$20)))-SIGN(-NETWORKDAYS(BP$20,BO$20))),0))))*$AN34)
BQ34=IF((IF($AA34="",MAX(((-NETWORKDAYS(BQ$20,MAX(BP$20,$Z34)))-SIGN(-NETWORKDAYS(BQ$20,MAX(BP$20,$Z34)))),0),MIN(MAX(((-NETWORKDAYS(BQ$20,MAX(BP$20,$Z34)))-SIGN(-NETWORKDAYS(BQ$20,MAX(BP$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BP$20))-SIGN(-NETWORKDAYS($AA34,BP$20))),((-NETWORKDAYS(BQ$20,BP$20))-SIGN(-NETWORKDAYS($AA34,BP$20)))),0))))=((-NETWORKDAYS(BQ$20,BP$20))-SIGN(-NETWORKDAYS(BQ$20,BP$20))),$AC34/12,(IF($AA34="",MAX(((-NETWORKDAYS(BQ$20,(MAX(BP$20,$Z34))))-SIGN(-NETWORKDAYS(BQ$20,(MAX(BP$20,$Z34))))),0),MIN(MAX((-NETWORKDAYS(BQ$20,(MAX(BP$20,$Z34))))-SIGN(-NETWORKDAYS(BQ$20,(MAX(BP$20,$Z34)))),0),MAX(MIN(((-NETWORKDAYS($AA34,BP$20))),((-NETWORKDAYS(BQ$20,BP$20)))-SIGN(-NETWORKDAYS(BQ$20,BP$20))),0))))*$AN34)
 
Upvote 0
Line 34 example -- calcing last workday in month or overlap to next month now works but calc is now not accurate for midmonth ranges
(issue => 6/1 to 6/4 = 4 BDs but cell is calcing off 3 BD)
 
Upvote 0
I think most would agree that we might be better able to help if you post some sample data (which you can do by following the link in my signature below).

I will say that whenever I see a formula with a dozen nested function statements I tend to believe there is a more fathomable and efficient method.

I haven't seen a reply yet... what's going on at MrExcel??? Hopefully people are just on a Labor Day long weekend hangover.
 
Upvote 0
Alright, so I posted my sample data with a thorough explanation... lets see these fathomable and efficient methods come to life! :)
 
Upvote 0
I'm hoping to bump this thread... I'm surprised I received no responses to this post.
If anyone could help, it would be greatly appreciated!
 
Upvote 0

Forum statistics

Threads
1,214,849
Messages
6,121,925
Members
449,056
Latest member
denissimo

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