Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Spreadsheet, finding the previous weekday

In Google Spreadsheet, or excel if its the same, how do I find the last weekday of day D only if D is not a weekday itself.

I.E:

If D equals weekday = do nothing (D equals D).
If D equals weekend = D equals last weekday.

Edit: i tried this to get the workday one month away:

WORKDAY(EDATE(N18, 1)+1, -1)

But I Was getting some weird results. Perhaps it counts red days as well, but I never specified the region anywhere.

Edit again:

This above example actually works, eg:

=WORKDAY("2013-04-06"+1, -1)
like image 650
mdc Avatar asked Dec 06 '25 23:12

mdc


1 Answers

=WORKDAY("2013-04-06"+1, -1)

...does the trick.

like image 92
mdc Avatar answered Dec 09 '25 16:12

mdc



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!