Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default How to shift a weekend date to the last or next workday

I have automatic payments due on the last day of the month, unless the last
day of the month is a weekend or holiday.
I don't know at this time if the payment will be made early - on the last
working day - or postponed - until the next working day.
I have tried to get the WORKDAY function to shift the date for me.
I can read the definition of WORKDAY in a way that indicates this can be
done. Maybe I am reading the definition wrong.

I have a column of biweekly dates including EOMONTH for each month and a
WORKDAY formula that does not work:
A1 = 1/5/2009 =IF(A1=WORKDAY(A1,0),A1,WORKDAY(A1,1
A2 = 1/19/2009 =IF(A2=WORKDAY(A2,0),A2,WORKDAY(A2,1)
A3 = 1/31/2009 =IF(A3=WORKDAY(A3,0),A3,WORKDAY(A3,1)
A4 = 2/2/2009 =IF(A4=WORKDAY(A4,0),A4,WORKDAY(A4,1)
A5 = 2/16/2009 =IF(A5=WORKDAY(A5,0),A5,WORKDAY(A5,1)
A6 = 2/28/2009 =IF(A6=WORKDAY(A6,0),A6,WORKDAY(A6,1)

The way I interpret the WORKDAY function is that if the date is NOT a
workday, the WORKDAY function should find and display the next workday with
argument 1, the last preceding workday with argument -1, and no date change
if argument is 0. In the example above, the formula returns exactly the
same dates as in column A, even though A3 and A6 dates are weekends. If I
replace the = in the formula with <, the weekend dates all are moved to the
next workday, as I need, but all the rest of dates have one day added as
well.

Any help to make this formula work for me would be appreciated, or any other
simple way to move a weekend date to a workday.

--
staplers
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How to shift a weekend date to the last or next workday

Try the below..to skip Saturdays and Sundays. Adjust to suit

=A1+LOOKUP(WEEKDAY(A1),{1,2,7},{1,0,2})

If this post helps click Yes
---------------
Jacob Skaria


"staplers" wrote:

I have automatic payments due on the last day of the month, unless the last
day of the month is a weekend or holiday.
I don't know at this time if the payment will be made early - on the last
working day - or postponed - until the next working day.
I have tried to get the WORKDAY function to shift the date for me.
I can read the definition of WORKDAY in a way that indicates this can be
done. Maybe I am reading the definition wrong.

I have a column of biweekly dates including EOMONTH for each month and a
WORKDAY formula that does not work:
A1 = 1/5/2009 =IF(A1=WORKDAY(A1,0),A1,WORKDAY(A1,1
A2 = 1/19/2009 =IF(A2=WORKDAY(A2,0),A2,WORKDAY(A2,1)
A3 = 1/31/2009 =IF(A3=WORKDAY(A3,0),A3,WORKDAY(A3,1)
A4 = 2/2/2009 =IF(A4=WORKDAY(A4,0),A4,WORKDAY(A4,1)
A5 = 2/16/2009 =IF(A5=WORKDAY(A5,0),A5,WORKDAY(A5,1)
A6 = 2/28/2009 =IF(A6=WORKDAY(A6,0),A6,WORKDAY(A6,1)

The way I interpret the WORKDAY function is that if the date is NOT a
workday, the WORKDAY function should find and display the next workday with
argument 1, the last preceding workday with argument -1, and no date change
if argument is 0. In the example above, the formula returns exactly the
same dates as in column A, even though A3 and A6 dates are weekends. If I
replace the = in the formula with <, the weekend dates all are moved to the
next workday, as I need, but all the rest of dates have one day added as
well.

Any help to make this formula work for me would be appreciated, or any other
simple way to move a weekend date to a workday.

--
staplers

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default How to shift a weekend date to the last or next workday

I am sure with the Add-In functions there should be a easy way to do
this...The below formula with MONTH() and WEEDAY() and LOOKUP() will adjust
to next/previous workday......

=IF(MONTH(A1+LOOKUP(WEEKDAY(A1),{1,2,7},{1,0,2}))< MONTH(A1),A1+LOOKUP(WEEKDAY(A1),{1,2,7},{-2,0,-1}),A1+LOOKUP(WEEKDAY(A1),{1,2,7},{1,0,2}))

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Try the below..to skip Saturdays and Sundays. Adjust to suit

=A1+LOOKUP(WEEKDAY(A1),{1,2,7},{1,0,2})

If this post helps click Yes
---------------
Jacob Skaria


"staplers" wrote:

I have automatic payments due on the last day of the month, unless the last
day of the month is a weekend or holiday.
I don't know at this time if the payment will be made early - on the last
working day - or postponed - until the next working day.
I have tried to get the WORKDAY function to shift the date for me.
I can read the definition of WORKDAY in a way that indicates this can be
done. Maybe I am reading the definition wrong.

I have a column of biweekly dates including EOMONTH for each month and a
WORKDAY formula that does not work:
A1 = 1/5/2009 =IF(A1=WORKDAY(A1,0),A1,WORKDAY(A1,1
A2 = 1/19/2009 =IF(A2=WORKDAY(A2,0),A2,WORKDAY(A2,1)
A3 = 1/31/2009 =IF(A3=WORKDAY(A3,0),A3,WORKDAY(A3,1)
A4 = 2/2/2009 =IF(A4=WORKDAY(A4,0),A4,WORKDAY(A4,1)
A5 = 2/16/2009 =IF(A5=WORKDAY(A5,0),A5,WORKDAY(A5,1)
A6 = 2/28/2009 =IF(A6=WORKDAY(A6,0),A6,WORKDAY(A6,1)

The way I interpret the WORKDAY function is that if the date is NOT a
workday, the WORKDAY function should find and display the next workday with
argument 1, the last preceding workday with argument -1, and no date change
if argument is 0. In the example above, the formula returns exactly the
same dates as in column A, even though A3 and A6 dates are weekends. If I
replace the = in the formula with <, the weekend dates all are moved to the
next workday, as I need, but all the rest of dates have one day added as
well.

Any help to make this formula work for me would be appreciated, or any other
simple way to move a weekend date to a workday.

--
staplers

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Friday as weekend in Workday Function Naushad Excel Worksheet Functions 6 March 15th 09 08:25 PM
How to make Friday as weekend instead of Sat/Sun in Workday Functi Naushad Excel Worksheet Functions 11 March 14th 09 05:06 PM
formual to determine if date falls on weekend, adjust date to Mond Bradley Excel Discussion (Misc queries) 4 November 21st 08 06:19 PM
If weekend date display previous Friday date jimar Excel Discussion (Misc queries) 4 September 17th 08 03:01 PM
If function for workday & weekend insplkm Excel Worksheet Functions 2 November 13th 05 01:24 AM


All times are GMT +1. The time now is 03:13 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"