calculate number of days between two dates excluding weekends in excel code example
Example 1: Google Sheets How to Count the Days Between Two Dates
# Basic syntax:
=DAYS("end_date", "start_date")
# Example:
=DAYS("01/01/2019","01/01/2018")
# Note, use =NETWORKDAYS for business days
Example 2: get days between two dates
function parseDate(str) {
var mdy = str.split('/');
return new Date(mdy[2], mdy[0]-1, mdy[1]);
}
function datediff(first, second) {
return Math.round((second-first)/(1000*60*60*24));
}
alert(datediff(parseDate(first.value), parseDate(second.value)));