![]() |
Subtract 2 days and if it falls on Sat or Sun display Friday.
=WORKDAY(A1,-3)
"ScottG" wrote: Date substraction - A1 has 4/2/2008 and I want to subtract three days. Therefore, the answer is 3/30/2008 (Sunday) then I want to fall back to Friday 3/28/2008. |
Subtract 2 days and if it falls on Sat or Sun display Friday.
On Mon, 31 Mar 2008 22:20:01 -0700, Teethless mama
wrote: =WORKDAY(A1,-3) I don't believe that is what th OP asked. Yours gives for Tuesday 4/1/2008 -- Thursday 3/27/2008 But 4/1/2008 less three days is Saturday 3/29/2008, so, by his request, you should only fall bact to Friday, not Thursday. "ScottG" wrote: Date substraction - A1 has 4/2/2008 and I want to subtract three days. Therefore, the answer is 3/30/2008 (Sunday) then I want to fall back to Friday 3/28/2008. =WORKDAY(A1-2,-1) --ron |
Subtract 2 days and if it falls on Sat or Sun display Friday.
The OP doesn't seem to have reached some servers, but it appears from the
quoted material that the subject line talked of subtracting 2 days whereas the text talked of subtracting 3 days, so I'm not surprised that TM and Ron were both confused. :-) The next confusion occurs as to whether the OP wanted to count back in working days (as TM's & Ron's formulae both do), or count back in days & then (if a weekend) find the previous working day (as the subject line implied). Once the question is clear, hopefully somone can come up with a suitable answer. -- David Biddulph "Ron Rosenfeld" wrote in message ... On Mon, 31 Mar 2008 22:20:01 -0700, Teethless mama wrote: =WORKDAY(A1,-3) I don't believe that is what th OP asked. Yours gives for Tuesday 4/1/2008 -- Thursday 3/27/2008 But 4/1/2008 less three days is Saturday 3/29/2008, so, by his request, you should only fall bact to Friday, not Thursday. "ScottG" wrote: Date substraction - A1 has 4/2/2008 and I want to subtract three days. Therefore, the answer is 3/30/2008 (Sunday) then I want to fall back to Friday 3/28/2008. =WORKDAY(A1-2,-1) --ron |
Subtract 2 days and if it falls on Sat or Sun display Friday.
On Tue, 1 Apr 2008 13:37:59 +0100, "David Biddulph" <groups [at]
biddulph.org.uk wrote: The next confusion occurs as to whether the OP wanted to count back in working days (as TM's & Ron's formulae both do), or count back in days & then (if a weekend) find the previous working day (as the subject line implied). My response was based on the quote showing the OP's example, where he subtracted three ordinary days and then one (or two) more if the result was a Saturday or Sunday. I never saw the original post, either. But he should be initially counting back in days (and not workdays), because if one counted back in Workdays, the result would never be a Saturday or Sunday. --ron |
All times are GMT +1. The time now is 10:17 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com