Saturday 25 February 2017

Get workdays between dates


Generic formula 
=NETWORKDAYS(start_date,end_date,holidays)




Explanation 
To calculate the number of workdays between two dates, you can use the NETWORKDAYS function. NETWORKDAYS automatically excludes weekends, and it can optionally exclude a custom list of holidays as well.
For example, if you have the date 2017/2/27 (a Monday) in cell B4, and 2017/3/3 (a Friday) in cell C4, this formula will return 5:
=NETWORKDAYS(B4,C4)
Note that NETWORKDAYS includes both the start and end dates in the calculation if they are workdays.
NETWORKDAYS can also exclude a custom list of holidays. For example, if you have holiday dates in H1:H10, you can tell NETWORKDAYS not to include these dates as workdays by adding that range as a third argument in the formula:
=NETWORKDAYS(B4,C4,B9:B11)

Custom weekends

If you need take into account custom weekends (i.e. weekends are Saturday only, Sunday and Monday, etc.) you'll need to switch to the more robust NETWORKDAYS.INTL function, which allows you to set what days of the week are considered are considered weekends, by supplying a weekend argument in the form of a numeric code. See NETWORKDAYS.INTL for more information.

You can download file from there  https://1drv.ms/x/s!Aj7aP_ymnvA3gZ5F1ggrqc8nAruAFQ
















No comments:

Post a Comment

how-to-recursively-create-subfolder-in-each-folder-of-a-directory-in-cmd

test.cmd: @echo off setlocal for /f "usebackq tokens=*" %%a in (`dir /b /a:d`) do ( rem enter the directory pushd %%a echo...