Thread: Dating Problem
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Harald Staff Harald Staff is offline
external usenet poster
 
Posts: 1,327
Default Dating Problem

Function WeeksMonday(Dt As Date) As Date
WeeksMonday = Dt - Weekday(Dt, vbMonday) + 1
End Function

HTH. Best wishes Harald

"Gary's Student" skrev i melding
...
I need a UDF that, given a date, returns the date of the Monday of that

week.
For example, if the input was a value between 6/20/2005 and 6/26/2005,

the
function would return 6/20/2005. If the input was 6/27/2005 the UDF

should
return 6/27/2005.

All I can think of is a massive VLOOKUP table. There has got to be a
cleaner way.

Thank you in advance

--
Gary's Student