excel - Check if date is within five working days -
i want create formula in excel check if date within 5 working days of today().
=if(h6<today()-14,"old",if(h6<today()-7,"last week", "this week"))
if date within 5 working days show 'this week', otherwise if date last week show 'last week' or if older show 'older'.
this works on 7 day assumption, how can work 5 working day week?
well ok can use networkdays see how many working days date before today, when today weekday gave same answer formula (almost - yours inclusive includes last monday, mine doesn't):-
=if(networkdays(a2,today())>10,"old",if(networkdays(a2,today())>5,"last week","this week"))
today @ time of writing 21st september 2015.
networkdays comes own if want omit public holidays.
if want see if day in same week today, use weeknum:-
=if(weeknum(today())-weeknum(a2)>1,"old",if(weeknum(today())-weeknum(a2)>0,"last week","this week"))
the default weeknum start week on sunday, can changed.
i'll put 3 formulae can compare them.
Comments
Post a Comment