+ Reply to Thread
Results 1 to 14 of 14

Converting a long line of monthly data in years.

  1. #1
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Converting a long line of monthly data in years.

    So I numerous list of data that are dated monthly in Col A and then Col B would the be associated data for that info in Col B. There would sometimes be more data in C,D,E,F and so on but they are always going to be on the same line. for that month in Col A.

    Some data is monthly for 5 years. Some for 10, and even so for 50 years.

    What i WANT to be able to do is have some kind of auto converter that takes that data and breaks it down into months by YEAR. So if there are 10 years... there would be 10 lines from Jan through December.

    Ideally it would be cool to say just show me the last 2, or 3, or 4 years and then do an average of whatever is left. that would be really cool.

    I have looked online to see how to do something like this and cant find a thing.

    Any ideas ???

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Converting a long line of monthly data in years.

    Please upload a workbook or a representative cut down copy, anonymised if necessary. It is always easier to advise if we can see your request in its context.

    Show a before and after situation with manually calculated results, explaining which information is data and which is results, and if it's not blindingly obvious how you have arrived at your results some explanatory notes as well.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Converting a long line of monthly data in years.

    So this would be a mock up of what I would like to be able to do.
    You dump your data in A:B
    F1 is some calculation that say how many years of data years of data You have in A:B

    You can see the flow in I5, I6, and I7 as to what I had to do to force the correct info there. I assume that would be some kind of macro?
    F2 is a USER INPUT where you would say how many individual years you want to show. In this case I said 2. That would mean that it would show the LAST two years of data as a line and then do an average by month for the remaining years (in this case 3 years). There might be a situation where I have 20 years of data and I would say 5 in F2 where is would show 6 lines on a graph, 2019, 2018, 2017, 2016, and the average of the rest.
    Does this help??
    Attached Files Attached Files

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Converting a long line of monthly data in years.

    You could summarise the data using a pivot table.
    If posting code please use code tags, see here.

  5. #5
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Converting a long line of monthly data in years.

    Sure that could work if i was the person doing the entry but i will not.

    The program will be used by people who barley know how to drop in the data let alone create a pivot table from it. It would need to be a macro.

    If anyone could help with that, it would be great.

  6. #6
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Converting a long line of monthly data in years.

    Perhaps i should move this post to the Macro VBA section.

    Does anyone know how to do that?

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,722

    Re: Converting a long line of monthly data in years.

    Yes.

    Is that what you would like to do?
    Dave

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,417

    Re: Converting a long line of monthly data in years.

    You could put this formula in cell I6:

    =IFERROR(INDEX($B:$B,MATCH(DATE($H6,COLUMNS($I:I),1),$A:$A,0)),"")

    then copy across and down as required.

    Hope this helps.

    Pete

  9. #9
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Converting a long line of monthly data in years.

    FlameRetired.... can you please move this to the VBA forum for me.....

  10. #10
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Converting a long line of monthly data in years.

    Quote Originally Posted by sungen99 View Post
    FlameRetired.... can you please move this to the VBA forum for me.....
    I'm not sure it actually makes much difference in truth, but no doubt Dave will move it for you.

  11. #11
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2504
    Posts
    13,722

    Re: Converting a long line of monthly data in years.

    Done._______________

  12. #12
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Converting a long line of monthly data in years.

    I know this thread got a little long as I had placed it in the wrong forum. But could anyone give me any assistance now that it has been moved to the correct one? I have included an attachment and explained what i am trying to accomplish if anyone could please help me.

    Thank you

  13. #13
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Converting a long line of monthly data in years.

    The F1 calculation is
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you have a list of all the years in column H then the I5 formula copied across becomes
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If you're trying to pick up the first value in every month of the year have you tried Pete's formula which seem to give you what you want when put in I6 and copied down and across.

    Is there some over-riding reason you only want to display the last n years defined by F2. It seems to me its more practical to have the years listed in descending order and have the whole table populated. If you want to highlight the latest n years then you could use a conditional format for the table starting at I6

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    See attached
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    05-05-2004
    MS-Off Ver
    Office 365
    Posts
    651

    Re: Converting a long line of monthly data in years.

    This is amazing!!!!!!!

+ 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. Convert daily sales data into monthly for many years
    By ibrahimdaas in forum Excel General
    Replies: 4
    Last Post: 04-11-2018, 04:35 PM
  2. Forecasting with set yearly average and 4 years of monthly data
    By Litkin in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-02-2016, 11:27 AM
  3. Converting weekly to monthly data and Yearly data to monthly
    By MilicaMatovic in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 01-29-2016, 09:48 AM
  4. [SOLVED] Generating monthly data for different years -formula
    By KK1234 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-15-2013, 06:57 PM
  5. Replies: 3
    Last Post: 06-27-2012, 02:58 PM
  6. Replies: 1
    Last Post: 12-05-2005, 08:35 AM
  7. [SOLVED] Comparing 2 years of data on a monthly basis
    By Roy in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 08-12-2005, 05:05 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