merging excel files into one but some columns are flipped

0

I have about 30 excel files, where I need to merge all like the following:

Excel file 1:

ID | Lat | Long | Name

1 | 33.3| 35.4 | X

...

Excel File 2:

ID | Long | Lat | Name | Additional_Field

3 | 36.4 | 34.2| XYZ | Yes

As you see, there is common columns in each file, and some extra fields in the other files, and some columns are flipped in some file, like excel file 2 where long column is before lat column

The result I want is the following:

ID | Lat | Long | Name

...data..

Where I don't want the additional fields that it doesn't exist in the other files.

Is there a way to do that ? I need to merge thousands of rows, so I can add them into database for some data management tasks.

alim1990

Posted 2017-02-28T08:29:45.997

Reputation: 107

Yes there is a way but what did you try? There is no point us giving suggesting if you've already tried it – Dave – 2017-02-28T08:48:32.993

Yes. I tried some functions like VLOOKUPS, but VLOOkUPS join according to a common value. And I don't want that – alim1990 – 2017-02-28T09:07:23.763

I don't understand why you've tagged with database – Dave – 2017-02-28T12:44:15.487

Answers

2

This is a good job for Power Query.

  1. Ensure all of your tables are Excel Tables Insert>Tables>Table.
  2. Ensure all of your tables have the same column names-capitalization is important, but order isn't.
  3. Load each table into Power Query Excel Data>From Table
  4. Perform an Append Query including each table, as discussed here.
  5. Let Power Query reorder the columns and merge the info into one table for you.

dav

Posted 2017-02-28T08:29:45.997

Reputation: 8 378