ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   weeknum formatting (https://www.excelbanter.com/excel-discussion-misc-queries/86176-weeknum-formatting.html)

Terri

weeknum formatting
 
I need to format the week of the year as 200617 (YYYYWW). Any Ideas?
I tried using the custom format under Format but it dispays as 2006ww.
Is there a way to format as 200617 (Year 2006 & Week 17)?

Kevin B

weeknum formatting
 
You can use a formula to get that result, but not a format.

The formula below concatenates the current year from a date, and the
current week from the date:

=Year(a1)&Weeknum(a1)

So if A1 had the date of 05/01/2006 and you put the formula in B1 the result
would be 200618
--
Kevin Backmann


"Terri" wrote:

I need to format the week of the year as 200617 (YYYYWW). Any Ideas?
I tried using the custom format under Format but it dispays as 2006ww.
Is there a way to format as 200617 (Year 2006 & Week 17)?


TKnTexas

weeknum formatting
 
You might want to do the formula as year(a1)&right("0"&weeknum(a1),2)
which will give you a result that is always six digits.



All times are GMT +1. The time now is 09:39 AM.

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