Date Functions

  • Thread starter Thread starter Luis
  • Start date Start date
Hello.
How can i, starting from a date, get the week number for
that date?


It depends on what you mean by a week number.

Look at Chip Pearson's discussion regarding this at
http://www.cpearson.com/excel/weeknum.htm

Also, at least in my version of Excel (2002), you can use the Format function
in VBA and write your own function. For the ISO weeknumber:

================
Function ISOWeeknum(dt As Date) as Integer
ISOWeeknum = Format(dt, "ww", vbMonday, vbFirstFourDays)
End Function
===================


--ron
 
Hi Luis!

First tell us what week number system you want to use:

1. The Analysis ToolPak WEEKNUM function allows two bases. Both
provide for Jan-1 as being the first day of week number 1 with the two
alternatives providing that Sunday (Alternative 1) or Monday
(Alternative 2) being the first day of all subsequent weeks.

2. We can also use a simple formula for calculating week numbers
where Jan-1 is defined as the first day of week one and all subsequent
weeks starting 7 days later.

3. There are formulas and functions for calculating week numbers
where the ISO8601:2000 algorithm is used. Monday is regarded as the
first day of the week with week 1 starting on the Monday of the week
containing Jan-4.

4. Financial Year based systems where the financial year might
start on a given date.


After that, life becomes easier.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.
 
Luis, have a look here http://www.cpearson.com/excel/weeknum.htm

--
Paul B
Always backup your data before trying something new
Please post any response to the newsgroups so others can benefit from it
Feedback on answers is always appreciated!
Using Excel 2000 & 97
** remove news from my email address to reply by email **
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top