Forum Discussion

Keith Lowery's avatar
Keith Lowery
Copper Contributor
Mar 05, 2018

Merging Datasets

I need to merge two columns of data by date.  Merge into SEPARATE columns, not merge into ONE CELL.

 

That is, 1 column has

Jan 1    10

Jan 2    20

Jan 4    30

 

and the other column has

Jan 1    5

Jan 2   10

Jan 3   15

 

I would like to merge them into 3 columns like

Jan 1    10    5

Jan 2    20    10

Jan 3    -       15

Jan 4     30     -

 

I appreciate it if anyone can help me.

  • Hello Keith,

     

    WOW! what a good question.

     

    I can write VBA code that does the job; however, I prefer using Power Query (Get & Transform) for doing this, because it will be dynamic and when you add or remove data, upon just a refresh the data will update.

     

    I have just recorded a video based on your example data set on how you can get the needed result using Power Query.    Power Query is built-in Feature in Excel 2016 and 365 and 2013 as Add-in and 2010 to be installed as separate add-in. 

     

    Please watch the animated gif. if you have any question, let me know.

     

    you can view the animated gif in large mode, if you click into the image.

     

     

    Untitled-Projectefd07e01e56a85f7.gif

  • Jamil's avatar
    Jamil
    Bronze Contributor

    Hello Keith,

     

    WOW! what a good question.

     

    I can write VBA code that does the job; however, I prefer using Power Query (Get & Transform) for doing this, because it will be dynamic and when you add or remove data, upon just a refresh the data will update.

     

    I have just recorded a video based on your example data set on how you can get the needed result using Power Query.    Power Query is built-in Feature in Excel 2016 and 365 and 2013 as Add-in and 2010 to be installed as separate add-in. 

     

    Please watch the animated gif. if you have any question, let me know.

     

    you can view the animated gif in large mode, if you click into the image.

     

     

    Untitled-Projectefd07e01e56a85f7.gif

    • Keith Lowery's avatar
      Keith Lowery
      Copper Contributor

      thank you for posting that video.

       

      I will try to use it.  LOL, the video is SO fast though, I'm not sure I can even see what you are doing in the video.

      • Jamil's avatar
        Jamil
        Bronze Contributor

        Keith, 

        Thanks for feedback :)

         

        I have uploaded a video version here, so that you can watch it at your pace.

Resources