ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Converting date to week number over several years (https://www.excelbanter.com/excel-discussion-misc-queries/241447-converting-date-week-number-over-several-years.html)

spudsnruf

Converting date to week number over several years
 
Hi,

I understand how to use the weeknum() function to conert a date to a week
number, but this is only useful if need to convert 1 year. What should I do
to convert 4 consecutive years to a week number, so all weeks numbers are not
the same. e.g I want to make January 1st 2006 as week '1' and January 1st
2007 '53' instead of 1 again. Thanks very much.



Jacob Skaria

Converting date to week number over several years
 
With the date in A1
=ROUNDUP(DATEDIF(DATE(2006,1,0),A1,"d")/7,0)

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


"spudsnruf" wrote:

Hi,

I understand how to use the weeknum() function to conert a date to a week
number, but this is only useful if need to convert 1 year. What should I do
to convert 4 consecutive years to a week number, so all weeks numbers are not
the same. e.g I want to make January 1st 2006 as week '1' and January 1st
2007 '53' instead of 1 again. Thanks very much.



spudsnruf

Converting date to week number over several years
 
Absolute genius. Works perfectly. saved me hours and hours. Thanks a million.

"Jacob Skaria" wrote:

With the date in A1
=ROUNDUP(DATEDIF(DATE(2006,1,0),A1,"d")/7,0)

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


"spudsnruf" wrote:

Hi,

I understand how to use the weeknum() function to conert a date to a week
number, but this is only useful if need to convert 1 year. What should I do
to convert 4 consecutive years to a week number, so all weeks numbers are not
the same. e.g I want to make January 1st 2006 as week '1' and January 1st
2007 '53' instead of 1 again. Thanks very much.



David Biddulph[_2_]

Converting date to week number over several years
 
.... or just =ROUNDUP((A1-DATE(2006,1,0))/7,0) ?
--
David Biddulph

"Jacob Skaria" wrote in message
...
With the date in A1
=ROUNDUP(DATEDIF(DATE(2006,1,0),A1,"d")/7,0)

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


"spudsnruf" wrote:

Hi,

I understand how to use the weeknum() function to conert a date to a week
number, but this is only useful if need to convert 1 year. What should I
do
to convert 4 consecutive years to a week number, so all weeks numbers are
not
the same. e.g I want to make January 1st 2006 as week '1' and January 1st
2007 '53' instead of 1 again. Thanks very much.






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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com