6 Replies Latest reply: Feb 7, 2014 12:19 PM by Michael Solomovich

# script for work days without year

Hi guys,

i have 2 fields : DAY MONTH

i need to calculate working days without YEAR

i.e. 09/02 i need to know number of working days from 01/01

I tried to use function nextworkingdays() but it doesn't work without a complete date filed(mm/dd/yyyy)

Can u help me pls?

• ###### Re: script for work days without year

Hi, the function working day needs the year because he works with this parameter.

it calculated the laboral day from each month depends of the year.

if you dont put the year, the function doesnt know what have to calculated, and the result will be incorrect

Fernando

• ###### Re: script for work days without year

is it possibile know the number of day in a year without the year information?

i.e. 01/02 is day number 2

tyvm

• ###### Re: script for work days without year

If you don't care, you can try

=makedate(2014, MONTH, DAY) - makedate(2014) +1

to get the date number,

or a little shorter:

DayNumberOfYear(makedate(2014, MONTH, DAY) )

• ###### Re: script for work days without year

it's not a problem, cause i need jurst a average value of woking days

So if i can calculate the day number of year without year i can  resolve my problem

tyvm

• ###### Re: script for work days without year

If you want an approximate number, you can use an assumption that five of each seven days are working days.  In this case, using Stefan's expression:

=DayNumberOfYear(makedate(2014, MONTH, DAY) ) *5/7

• ###### Re: script for work days without year

You don't know the year for your DAY MONTH values? Then I think you can't calculate the working days between two DAY MONTH combinations.

If you know the year, but it's just not available in your source data, you can create complete dates in networkdays() function, like

=networkdays(makedate(2014), makedate(2014,MONTH,DAY) )