简体   繁体   中英

How to get the week number of the year from the date range in an Excel Pivot Table

Hi I would like to know a formula where I can convert a grouped date range into the week number of the year. For example column A has the date ranges. I want column B to have the week number. So it will be like the example below

    Column A                           Column B 

31/12/2013 - 06/01/2013............................................Week 1

07/01/2013 - 13/01/2013............................................Week 2

Thanks to anyone who can solve this. Its been bugging me out

You could perhaps use something like that:

=(RIGHT(A2,10)*1-41273)/7

This takes the last date in that date range, turns it into a number and subtracts 41273 (which is the equivalent of 1st January 2013) and divides the result by 7.

If you want to specifically get Week 1 , you can either use custom formatting with "Week "# , or if you want the literal Week , you can use ="Week "&(RIGHT(A2,10)*1-41273)/7

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM