Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: ms excel: data conversion from month to weeks  (Read 2767 times)

0 Members and 1 Guest are viewing this topic.

lalala

  • Guest
ms excel: data conversion from month to weeks
« on: November 16, 2006, 01:26:39 AM »
Hi all!

I am working on this "maintenance schedule" that is currently sorted out into tabs that are organized into the 12 months, jan, feb and so on.

I have to write either a command or a program that would be efficient enough to easily convert these monthly data in weekly ones.

So the command would have to convert those "jan, feb, mar... ...dec" tabs into "week 1, week 2, week 3... ...week 52". (prefably by linking them up some how)

Does anyone have any suggestions on how i go about doing this?

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: ms excel: data conversion from month to weeks
« Reply #1 on: November 16, 2006, 06:58:58 AM »
Check out the VBA function DatePart. By using "ww" as the interval parameter, you can place a date into a specific week of the year.

Good luck.  8-)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein

lalala

  • Guest
Re: ms excel: data conversion from month to weeks
« Reply #2 on: November 16, 2006, 05:52:17 PM »
i uploaded a picture... hmmm but how do i use a command that can convert all the 12 worksheets (in months) to become 52 workseets (in weeks) instead?

http://www.excelforum.com/showthread.php?t=580648

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: ms excel: data conversion from month to weeks
« Reply #3 on: November 16, 2006, 08:23:12 PM »
Do you really need a separate sheet for each week or would some kind of analysis by week, within each month's sheet, be sufficient?

lalala

  • Guest
Re: ms excel: data conversion from month to weeks
« Reply #4 on: November 16, 2006, 09:48:54 PM »
it would be the best if all the 52 weeks can be on separate sheets so the sheets have to be numbered from week 1 to 52, rather than week 1 to 4 in each month's sheet.

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: ms excel: data conversion from month to weeks
« Reply #5 on: November 17, 2006, 05:39:15 AM »
It would be easy enough for a macro to create your new workbook and add 52 53 worksheets. Unfortunately, your existing workbook has information gaps. In the sample you posted, the first entry would be simple. Assuming you're going to use the "Planned Start Date", you would run Oct 2 thru the VBA DatePart function resulting in week 40, whereupon the macro would copy all the data from that row into the new "Week 40" worksheet.

The next entry (17 Aug) is just strange. Why is it even on the Oct worksheet? Nevertheless, the macro would still be able to compute it's new home on the Week 33 worksheet and copy the data accordingly.

The fourth entry is where everything breaks down; there is no date. Why is it on the October worksheet? Who put it there? Is there a piece of information not shown in the sample that indicates this entry belongs on the October worksheet? By the fact that it's current home is on the October sheet, the macro could narrow it down to the four or five weeks in October...but which week?

Without knowing the rhyme or reason as to how and why entries were posted to each months worksheet, you might need to resort to ye olde copy/paste method.

Good luck. 8-)
« Last Edit: November 17, 2006, 05:51:53 AM by Sidewinder »
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein