Help change Friday to following Monday

D

David

XL2000
I currently use the following formula to return the Friday before the 17th
of the month if the 17th falls on a weekend:

=DATE(YEAR(NOW()),MONTH(NOW()),17)-MAX(0,WEEKDAY(DATE(YEAR(NOW()),MONTH(NOW
()),17),2)-5)
(Excuse the wrapping, please)

What I would like instead, is a formula to return the date of the following
Monday if the 17th falls on a weekend. I don't want to use the Workday()
function, because the file will often be viewed on machines that don't have
the Analysis Toolpak available.

Simple for someone who knows how(?), but not for me :(
 
D

daddylonglegs

Here's one way....

=DATE(YEAR(NOW()),MONTH(NOW()),17)+CHOOSE(WEEKDAY(DATE(YEAR(NOW()),MONTH(NOW()),17)),1,0,0,0,0,0,2)
 
S

SimonCC

Try
=DATE(YEAR(NOW()),MONTH(NOW()),17)+8-WEEKDAY(DATE(YEAR(NOW()),MONTH(NOW()),17),2)

-Simon
 
D

David

daddylonglegs wrote
Here's one way....

=DATE(YEAR(NOW()),MONTH(NOW()),17)+CHOOSE(WEEKDAY(DATE(YEAR(NOW()),MONT
H(NOW()),17)),1,0,0,0,0,0,2)

That works as desired. Many thanks.
 
D

David

This works under limited conditions, but fails to satisfy my requirements:
If the 17th falls outside the weekend (M-F), leave it as the 17th. It
instead *always* returns the following Monday.

Thanks for the effort anyway.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top