A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
THANK YOU SO MUCH! Mike, It work!!!. Can you explain to me the use " ,2) 0,0,0,02,1)' is this counts the day?
Hi,
Glad that worked and thanks for the feed back. How it works is very simple
=EDATE(A2,-2)+CHOOSE(WEEKDAY(EDATE(A2,-2),2),0,0,0,0,0,2,1)
We get a date 2 months in the past with the first underlined bit and in the seconds underlined bit we get the date again and using the WEEKDAY function we check which day of the week it is. Monday returns 1 thru Sunday which returns 7.
Now we use the CHOOSE bit which takes that number 1 thru 7 and it adds the number of days specified in the Bold bit so for Monday thru Friday ( the first 5 zeroes) it adds zero but for Saturday (6) it adds the 6th number in bold which is 2 and we get Monday and for Sunday (7) it adds the 7th number in the list (1) and likewise we get Monday.