Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Finding The Next Monday From a Date

Hi You All helped me with the number of days in a month
and I Thank you for it, I need help again with how to find
the next Monday from a date chosen by the user if he picks
a day other than Monday. Is this possible to do in VBA
code if so can someone point me in the right direction.
TIA
Charles
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Finding The Next Monday From a Date

Hi Charles
try the following (if A1 stores your base date)
=A1+(WEEKDAY(A1)2)*7-WEEKDAY(A1)+2

--
Regards
Frank Kabel
Frankfurt, Germany

Charles wrote:
Hi You All helped me with the number of days in a month
and I Thank you for it, I need help again with how to find
the next Monday from a date chosen by the user if he picks
a day other than Monday. Is this possible to do in VBA
code if so can someone point me in the right direction.
TIA
Charles

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Finding The Next Monday From a Date


Norman Harker wrote:
Hi Charles!

My approach finds the next Monday. However, if the user puts in (say)
Monday 8-Mar-2004 it will return Monday 15-Mar-2004. You may not want
this! If you want either the same day, if a Monday or the next Monday
then use:

=IF(WEEKDAY(A1)=2,A1,A1-WEEKDAY(A1-1)+8)


or without IF function :-)
=A1+(WEEKDAY(A1)2)*7-WEEKDAY(A1)+2



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Finding The Next Monday From a Date

Sub mon(
a = Range("a2").Formul
For c = 1 To
y = a +
If Format(y, "ddd") = "Mon" Then Range("a3").Value = Format(a + c, "mm/dd/yyyy"
Next
End Sub
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Finding The Next Monday From a Date

Norman Harker wrote:
Hi Frank!

Sure! Although I suppose you could say that you're still using an
implicit IF function.


You're right
Was just in my picky mood :-)

Greetings to Australia
Frank
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 162
Default Finding The Next Monday From a Date

Hi Frank!

Nothing wrong with being picky!

And another implicit approach:

=A1-WEEKDAY(A1-1)+8-(WEEKDAY(A1)=2)*7

Greeting to Germany from a still hot Australia.

--
Regards
Norman Harker MVP (Excel)
Sydney, Australia

Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
"Frank Kabel" wrote in message
...
Norman Harker wrote:
Hi Frank!

Sure! Although I suppose you could say that you're still using an
implicit IF function.


You're right
Was just in my picky mood :-)

Greetings to Australia
Frank



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
date should always be Monday Wanna Learn Excel Discussion (Misc queries) 1 March 17th 09 04:21 PM
Date calculation for Monday of one month to the Monday of the next Sunnyskies Excel Discussion (Misc queries) 19 July 2nd 07 12:08 PM
Finding the date on the 'nth' Monday in this Month in this Year agarwaldvk Excel Worksheet Functions 1 April 17th 06 10:53 PM
Finding the Monday date based on a different date in same week dandiehl Excel Worksheet Functions 4 April 11th 06 06:03 PM
Date to a day (Monday, Tue, etc?) Taylor Excel Discussion (Misc queries) 4 August 31st 05 10:58 PM


All times are GMT +1. The time now is 04:34 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"