View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default date filtering by number

On Fri, 9 Oct 2009 19:53:03 -0700 (PDT), Lynn
wrote:

I have a spreadsheet that lists, with start dates in column C. I would
like to be able to automatically number the dates which fall within
the same week

example, if start date falls within this week, column D will be
labelled as 1. if start date falls within next week, column D will be
labelled as 2. if start date falls within 3rd week, column D will be
labelled as 3.... and so on...

Can anyone clue me in as to how to do this?



Assuming that a week starts on a Monday, try this formula in cell D1:

=1+INT((C1-TODAY()+WEEKDAY(TODAY(),3))/7)

Hope this helps / Lars-Åke