+ Reply to Thread
Results 1 to 6 of 6

macro to shift data to adjacent columns based on dates

  1. #1
    Registered User
    Join Date
    09-10-2013
    Location
    washington, dc
    MS-Off Ver
    Excel 2010
    Posts
    10

    macro to shift data to adjacent columns based on dates

    I have attached sample data, the "initial" sheet is what the data looks like currently and the "final" sheet is what I'm hoping to make it look like at the end. What I basically want to do is run through the data and shift all data in the year 2014 to the adjacent cells of the year 2013 (see "final" sheet for visual) as it relates to column A. I then want to take the totals of column D and E and average them out (see "final" sheet).

    Any help on this would be greatly appreciated.

    Thank you.

    sample data.xlsx

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: macro to shift data to adjacent columns based on dates

    Before to go forward does present result OK: Is missing Sum and Average
    BTW your file is very helpful (and well done)
    Attached Files Attached Files
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    09-10-2013
    Location
    washington, dc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: macro to shift data to adjacent columns based on dates

    Wow, that was incredibly better than what I had been attempting to do, it works very well!

  4. #4
    Registered User
    Join Date
    09-10-2013
    Location
    washington, dc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: macro to shift data to adjacent columns based on dates

    Not to ask for too much, but would you also have an elegant solution to the second half of the problem as well (totals, average)?

    Thank you sooo much, this was way more help than I was expecting!

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: macro to shift data to adjacent columns based on dates

    See attached and comment
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    09-10-2013
    Location
    washington, dc
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: macro to shift data to adjacent columns based on dates

    Thank you, this is EXACTLY what I needed!!

+ 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. How to shift an array of data into columns based on unique identifiers...
    By PolishJoke in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-11-2014, 06:05 PM
  2. [SOLVED] Macro to sort and place data in adjacent columns
    By T15K in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-01-2013, 06:14 AM
  3. Macro to Shift Columns based on Rank Value
    By eemrun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-03-2013, 07:11 AM
  4. macro for conditional formatting based on the comparing values from adjacent columns
    By jkmasurkar in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 12-18-2012, 07:18 AM
  5. Replies: 3
    Last Post: 07-30-2012, 11:20 AM

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