+ Reply to Thread
Results 1 to 10 of 10

Suggest formula for matching columns in large data dump from data source

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Suggest formula for matching columns in large data dump from data source

    All,

    I have a spreadsheet that pulls data from a large database with over 100+ columns. When I pull the data from the system to populate the spreadsheet, the columns are out of order and I can't fix. Basically:

    1) Spreadsheet 1 has 100+ columns of data that formulas throughout the workbook will read data from based on the column names.
    2) Spreadsheet 2 is a data dump with the same data as Spreadsheet 1 or maybe extra columns that are unneeded.
    3) Spreadsheet 2's columns are out of order compared with Spreadsheet 1.

    Any suggested paths to look down?

  2. #2
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Suggest formula for matching columns in large data dump from data source

    INDEX/MATCH or OFFSET/MATCH combos would probably do it.
    Formula: copy to clipboard
    OFFSET('Spreadsheet 1'!$A:$A,0,MATCH("Heading Name",'Spreadsheet 1'!$1:$1),0)-1)
    as a range within a formula will return the column headed with "Heading Name", assuming the column headers are in row 1 of Spreadsheet 1, and that there are no blank columns before the last column of data.

  3. #3
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Re: Suggest formula for matching columns in large data dump from data source

    The match part makes sense - scan the column until you match the headings. But why A:A? Does the formula offset based on the first columns. I use excel so much that I should really know this stuff by now

  4. #4
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Suggest formula for matching columns in large data dump from data source

    You need to give the OFFSET formula a starting point to offset from. Using the first column makes sense. Using the entire column means that the offset will also return an entire column.

  5. #5
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Re: Suggest formula for matching columns in large data dump from data source

    I've attached a basic example with the ref error. Note that columns 1 and 2 are mixed up in the two tabs. I've been trying to fix it but to no avail. Thanks for your help everyone.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Re: Suggest formula for matching columns in large data dump from data source

    That makes sense. Getting a ref error and not sure why. My formula looks like this:
    =OFFSET('Air Detail with Reportable Fiel'!$A:$A,0,MATCH(A$1,'Air Detail with Reportable Fiel'!1:1),0)-1

    It's looking at the heading name in A$1, and trying to pull the data from the other file. On reflection this looks right but maybe something missing?

  7. #7
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Suggest formula for matching columns in large data dump from data source

    Sorry - as you didn't upload a sample file I did the formula just on here, not in Excel so didn't pick up my error. Try this instead:
    Formula: copy to clipboard
    OFFSET('Air Detail with Reportable Fiel'!$A:$A,0,MATCH(A$1,'Air Detail with Reportable Fiel'!1:1,0)-1)


    You won't be able to use this as a stand alone formula as the result is a range of cells, in this case an entire column. You would use this as part of another formula to refer to the column you wanted. Eg
    Formula: copy to clipboard
    =sumif(OFFSET('Air Detail with Reportable Fiel'!$A:$A,0,MATCH(A$1,'Air Detail with Reportable Fiel'!1:1,0)-1),">1000")

  8. #8
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2013
    Posts
    200

    Re: Suggest formula for matching columns in large data dump from data source

    Thanks for trying. As you mentioned the first solution returns only the first row. The second solution gives me "0" as the returned value, and doesnt' work for the other rows.

  9. #9
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Suggest formula for matching columns in large data dump from data source

    If you had uploaded a sample file to start with we could have gotten there a lot quicker, but I have used INDEX/MATCH rather than OFFSET/MATCH in your attached example file, using the Record Key as a unique identifier.

    Example Book.xlsx

  10. #10
    Valued Forum Contributor
    Join Date
    04-22-2014
    Location
    Auckland, New Zealand
    MS-Off Ver
    Office 365 (work) and Excel 2013 (home)
    Posts
    1,167

    Re: Suggest formula for matching columns in large data dump from data source

    This is basically the same formula but allows for any number of rows of data:
    Formula: copy to clipboard
    =INDEX('Air Detail with Reportable Fiel'!$A:$I,MATCH(BCDAir!$A2,'Air Detail with Reportable Fiel'!$B:$B,0),MATCH(BCDAir!B$1,'Air Detail with Reportable Fiel'!$1:$1,0))

+ 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. data problems, matching large data sets with smaller known points
    By awguest1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-28-2013, 08:48 PM
  2. How to create a simple formula for a data dump
    By blue_izce8 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-07-2013, 06:32 PM
  3. Replies: 2
    Last Post: 04-18-2013, 05:56 PM
  4. Data matching from 2 large data sets
    By chemnerd1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-31-2008, 04:22 AM
  5. Condensing a large data dump
    By Ant in forum Excel General
    Replies: 1
    Last Post: 10-04-2005, 02: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