Help calculate contractor costs by months or quarters

Des66

New Member
Joined
Sep 29, 2018
Messages
1
Hi. I'm trying to write a formula to calculate the cost of various employees spread over months (or quarters) so I can create graphs of the annual cost impact to a business. They all have different contract start and end dates along with varying daily rates of pay. Can anyone help me please? If a formula is not the best approach then please suggest an alternative as I'm stumped after being told I need to assume 20 working days per month so can't use networkdays!

Example below shows the expected results which were done manually for visualisation but obviously I don't want to trawl through 1000s of rows of data manually.... Thanks in advance :)

Contractor Day RateStart DateEnd Date01-Jan-1801-Feb-1801-Mar-1801-Apr-1801-May-1801-Jun-1801-Jul-1801-Aug-1801-Sep-1801-Oct-18
Bob£22501/02/2018 15/03/2018£0£4,500£2,475£0
Anne£57505/02/201820/04/2018£0£10,350£11,500£8,625
Chris£30010/01/201811/06/2019£4,800£6,000£6,000£6,000
Tim£48010/03/201826/11/2018£0£0£9,600£9,600
Jerry£65001/04/201802/08/2018£0£0£0£13,000
Kate£20001/07/201530/06/2019£4,000£4,000£4,000£4,000
Jack£35018/04/201725/03/2019£7,000£7,000£7,000£7,000
Mary£29531/01/201719/06/2018£5,900£5,900£5,900£5,900
Pete£47017/09/201829/06/2019£0£0£0£9,400
Susan£38022/07/201829/01/2019£0£0£0£7,600

<tbody>
</tbody>
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
I think this will work
BUT your Pete and Susan looks wrong
and Tim - starts in March , but you have 9,600

=IF(AND($C2>E$1,$D2<EOMONTH(E$1,0)),($D2-$C2)*$B2,IF(OR($C2>EOMONTH(E$1,0),$D2<=E$1),0,IF(AND($C2<=E$1,$D2>=EOMONTH(E$1,0)),20*$B2,IF(AND($D2<EOMONTH(E$1,0),$D2>=E$1),NETWORKDAYS(E$1,$D2)*$B2,IF(AND($D2>=EOMONTH(E$1,0),$C2>=E$1),NETWORKDAYS($C2,EOMONTH(E$1,0))*$B2,"tba")))))
 
Upvote 0
sorry that has been changed by the forum
=IF(AND($C2 > E$1,$D2 < EOMONTH(E$1,0)),NETWORKDAYS($C2,$D2)*$B2,IF(OR($C2 > EOMONTH(E$1,0),$D2 < = E$1),0,IF(AND($C2 < =E$1,$D2 > = EOMONTH(E$1,0)),20*$B2,IF(AND($D2 < EOMONTH(E$1,0),$D2 > = E$1),NETWORKDAYS(E$1,$D2)*$B2,IF(AND($D2 > = EOMONTH(E$1,0),$C2 > = E$1),NETWORKDAYS($C2,EOMONTH(E$1,0))*$B2,"tba")))))

there may be an issue with networkdays and if part of a month
ie 2/jan to 31/jan = 21 Not 20
 
Last edited:
Upvote 0
i have added a floor to stop 2/1/18 to 30/1/18 more than 20 days

=IF(AND($C2 > = E$1,$D2 < = EOMONTH(E$1,0)),FLOOR(NETWORKDAYS($C2,$D2),20)*$B2,IF(OR($C2 > EOMONTH(E$1,0),$D2 < = E$1),0,IF(AND($C2 < = E$1,$D2 > = EOMONTH(E$1,0)),20*$B2,IF(AND($D2 < EOMONTH(E$1,0),$D2 > = E$1),NETWORKDAYS(E$1,$D2)*$B2,IF(AND($D2 > = EOMONTH(E$1,0),$C2 > = E$1),NETWORKDAYS($C2,EOMONTH(E$1,0))*$B2,"tba")))))
 
Upvote 0

Forum statistics

Threads
1,214,927
Messages
6,122,311
Members
449,080
Latest member
jmsotelo

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