+ Reply to Thread
Results 1 to 13 of 13

Formula to convert monthly data into weekly data - help needed

  1. #1
    Registered User
    Join Date
    11-11-2016
    Location
    Brno, Czech Republic
    MS-Off Ver
    MS Office 2010
    Posts
    6

    Formula to convert monthly data into weekly data - help needed

    Dear Excel Forum members,

    I have a difficult problem in converting monthly data to weekly data.
    Context: I have 21 EU countries with weekly data regarding the price of gasoline between 2005-2014 (1 year contains 52 data for each year). But the inflation rate is only reported in monthly data. So, I would like to convert monthly inflation data into weekly data to match the price of gasoline for each country and each year. It is time consuming filling manually each cell through Copy-Paste, and I would like to ask you if there is some formula to ease my work?
    The weekly data looks like this (please be aware that 200501 - in case of weekly data represent the week number 1 of year 2005):
    Country Date Pricegasoline
    AT 200501 916
    AT 200502 916
    AT 200503 907
    AT 200504 910
    ... ... ...
    AT 200552 1038

    And the inflation rate is monthly (please be aware that 200501 represent month number 1 of year 2005):

    Country Date Inflation
    AT 200501 99.15
    AT 200502 99.48
    ... ... ...
    AT 200512 100.69

    How can I convert inflation from monthly to appear in weekly, meaning for the first four weeks of January 2005 inflation rate should appear 99.15, and then for the next 4 weeks of February the inflation rate should appear 99.48 and so on?
    Meaning:
    Ctry Date(week) Pricegasoline Inflation
    AT 200501 916 99.15
    AT 200502 916 99.15
    AT 200503 907 99.15
    AT 200504 910 99.15
    AT 200505 907 99.48
    AT 200506 919 99.48
    and so on.
    I would like to mention that I did not declare in Excel "Date (weekly and montly)" as date they appear just as simple numbers.
    On 05.08.2014 the user FSmit posted as similar problem and user ragulduy replied with a possible solution. Unfortunately, I've tried it and it does not work for me. I would like to mention also that I am using MS Office 2010.
    Please find attached the example in .xlsx format.
    I would like to thank you in advance for your help and time.

    Best regards, Marian
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Formula to convert monthly data into weekly data - help needed

    The main issue is that 12 * 4 week months = 48 weeks: so how do we "allocate" the 4 (52-48) extra weeks? E.g. Week 5 is part January and part February.

  3. #3
    Registered User
    Join Date
    11-11-2016
    Location
    Brno, Czech Republic
    MS-Off Ver
    MS Office 2010
    Posts
    6

    Re: Formula to convert monthly data into weekly data - help needed

    Dear John Topley,

    What if I would transform "200501" from a simple number and declare that as week 1 of 2005, not a number but a date? Would that help? Or it is much more complicate than this? Meaning, it should start with days, then transformed in weeks and then apply the right formula. It is beyond my understanding, how should this work.
    Thanks for your reply.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: Formula to convert monthly data into weekly data - help needed

    Try this in D2:

    =DATE(LEFT(B2,4),1,RIGHT(B2,2)*7-6)

    Copy down.

  5. #5
    Registered User
    Join Date
    11-11-2016
    Location
    Brno, Czech Republic
    MS-Off Ver
    MS Office 2010
    Posts
    6

    Re: Formula to convert monthly data into weekly data - help needed

    Many thanks Phuocam. I got something like 1/1/2005 meaning it is declared in weeks. Now the question how can I allocate monthly data for each week? I have almost 14000 observations for 21 countries, so I really need a formula.

  6. #6
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: Formula to convert monthly data into weekly data - help needed

    Quote Originally Posted by dobrica3 View Post
    Now the question how can I allocate monthly data for each week?
    Or ...

    =TEXT(DATE(LEFT(B2,4),1,RIGHT(B2,2)*7-6),"yyyy\Mmm")
    Last edited by Phuocam; 11-12-2016 at 09:33 AM.

  7. #7
    Registered User
    Join Date
    11-11-2016
    Location
    Brno, Czech Republic
    MS-Off Ver
    MS Office 2010
    Posts
    6

    Re: Formula to convert monthly data into weekly data - help needed

    Ok. So both columns - Monthly and Weekly were declared as data and not just simple numbers. Once I have this transformations, how can I allocate January 2005 inflation to appear in the first 5 weeks the same, meaning 99.15. Then for 4 weeks of February 2005 the inflation should appear 99.48, and so on?

  8. #8
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Formula to convert monthly data into weekly data - help needed

    How do you want to handle a date which falls in mid-week so Wednesday is month N and Thursday onwards is month N+1 i,e midway in Week x ?

    Or is Phuocam's solution OK?
    Last edited by JohnTopley; 11-12-2016 at 09:28 AM.

  9. #9
    Registered User
    Join Date
    11-11-2016
    Location
    Brno, Czech Republic
    MS-Off Ver
    MS Office 2010
    Posts
    6

    Re: Formula to convert monthly data into weekly data - help needed

    To be honest, we don't need to be so strict or the allocation of data should not match rigorously weekly and monthly. There is no problem if midweeks take month N+1 inflation rate. Ideally would be the exact match, but if it is not possible then I'm happy with an allocation that has few mismatches.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Formula to convert monthly data into weekly data - help needed

    With Phocam's formula in column D

    in E2 and copy down

    =INDEX($H$2:$H$25,MATCH(SUBSTITUTE(D2,"/","M"),$G$2:$G$100),0)
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,911

    Re: Formula to convert monthly data into weekly data - help needed

    Sorry, use:

    =TEXT(DATE(LEFT(B2,4),1,RIGHT(B2,2)*7-6),"yyyy\Mmm")

    not SUBSTITUTE.
    Last edited by Phuocam; 11-12-2016 at 09:43 AM.

  12. #12
    Registered User
    Join Date
    11-11-2016
    Location
    Brno, Czech Republic
    MS-Off Ver
    MS Office 2010
    Posts
    6

    Re: Formula to convert monthly data into weekly data - help needed

    Dear Both John Topley and Phuocam,

    You are amazing! It works! You saved me hours and hours of Copy-Paste.
    I will strongly recommend this forum to my colleagues.
    Many thanks to both of you. This thread can be declared as SOLVED.

    Best, Marian

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Formula to convert monthly data into weekly data - help needed

    You are very welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel 2007 : How to convert weekly data to monthly data
    By kissanbhai009 in forum Excel General
    Replies: 3
    Last Post: 08-10-2017, 04:35 AM
  2. Convert weekly to monthly data
    By Svilen Pachedzhiev in forum Excel General
    Replies: 5
    Last Post: 08-10-2017, 04:09 AM
  3. [SOLVED] Formula to convert monthly data to weekly data
    By FSmit in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 05-15-2014, 09:12 AM
  4. formula for calulating weekly totals for monthly data
    By Chgardne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2014, 04:15 AM
  5. [SOLVED] Formula to sum monthly result given weekly data
    By tantcu in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 08-16-2013, 06:40 PM
  6. Prorate formula for weekly to monthly data
    By randym44 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-28-2011, 03:02 AM
  7. Using weekly data to convert to monthly
    By 1.zer0 in forum Excel General
    Replies: 10
    Last Post: 09-27-2010, 04:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1