Calculate # of days from start & finish dates etc.

KJG03

New Member
Joined
Sep 16, 2018
Messages
7
Hi all. I'm needing to calculate the number of days employed for the financial year if there is either a start and/or a finish date. But if both are blank, as it is for the employee in Row 7, then I need it to return the value of 365.
Hoping you can help. See below screenshot. Thanks in advance.

JKL
1
2
3Start FY01/07/2018
4End FY01/07/2019
5Start DateFinish DateNo. of days employed this FY
601/10/2018
7
831/08/2019

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Wages 2018-19

Worksheet Formulas
CellFormula
J1
K1
L1
J2
K2
L2
J3Start FY
K3
L343282
J4End FY
K4
L443647
J5Start Date
K5Finish Date
L5No. of days employed this FY
J643374
K6
L6
J7
K7
L7
J8
K843708
L8

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
=IF(AND(J7="",K7=""),365, "your formulas for working out dates when there is an entry")
 
Upvote 0
Thanks Wayne. The first part is a great help. I'm also getting stuck on what the rest would be as I need it to calculate days worked in the year if either start or finish dates are entered or both have an entry. That's why I have the start of Financial Year and End of Financial Year dates in cells L3 & L4 to use as a calculation base. But just not sure how to include all those variables in the formula.
 
Upvote 0
just checking the rules
if the startdate is blank, but the end date is not
then you want to use L3 at the start date (in your example) and K8 as your end date - However, K8 is greater than the end of the fiscal - so would that be 365 as well.

If the start date (J8) is before the fiscal start and the enddate (K8) is after the fiscal end , then is that also 365

so above we now have 3 rules for putting in 365

after those tests , then the start date (J6) and end date (K6) will have dates in that are within the fiscal or one of the cells is blank

then we have 3 calculations to make
J6 and K6 have dates in
so its just K6-J6
J6 is blank but K6 is not - and we know it must have a date that is not greater than the fiscal end
K6 - $L$3

K6 is blank but J6 is not - and we know it must have a date that is not greater than the fiscal end
$L$4 - J6

is that all the logic to test
if so we can use a combination of Nested ifs and ANDs
But first can we just check that all the possible entries and scenarios and the results needed
 
Upvote 0
Welcome to the MrExcel board!

Try this, copied down.
Note that this will return 366 for a full year if the year includes a leap-year February. Is that what you want?

Excel Workbook
JKL
3Start FY1/07/2018
4End FY1/07/2019
5Start DateFinish DateNo. of days employed this FY
61/10/2018273
7365
831/08/2019365
915/08/201816/08/20182
101/01/20143/07/20183
1129/06/201923/07/20192
Days Employed
 
Last edited:
Upvote 0
Thanks Wayne. Yes I should have had 30/6/19 as the end date. Peter's solution worked.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,701
Members
448,980
Latest member
CarlosWin

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