Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted

Concatenating two databases from the same Excel Spreadsheet

Hello all,

I tried concatenating two databases from the same excel spreadsheet multiple times, but was unable to do so. Does anyone have any suggestions?
5 REPLIES 5
mpb
Super User mpb
Super User

Re: Concatenating two databases from the same Excel Spreadsheet

Are you trying to do the concatenation via scripting? Or are you having trouble concatenating them even manually through the table menu?
Highlighted

Re: Concatenating two databases from the same Excel Spreadsheet

Via scripting, I can see easily enough how to do it manually, but writing a script has eluded me.
Highlighted
mpb
Super User mpb
Super User

Re: Concatenating two databases from the same Excel Spreadsheet

The code in this post has been superceded by the next one

Here's a rough starting example which assumes the user selects exactly 2 sheets from the .xls file.

Highlighted
mpb
Super User mpb
Super User

Re: Concatenating two databases from the same Excel Spreadsheet

I was reminded of the fact that Data Table(1) corresponds to the most recent data table, Data Table(2) to the next most recent and so on. This makes my previously posted snippet work correctly only if there are no other open tables when it is run. Here is one that should work correctly even if there are other tables open. It still requires work to make it robust to other possibilities.
Highlighted

Re: Concatenating two databases from the same Excel Spreadsheet

Thank you very much for the reply! As soon as I have a chance to try this out, I will, and I'll let you know how it works for me.
Article Labels

    There are no labels assigned to this post.