+ Reply to Thread
Results 1 to 5 of 5

Lookup multiple Columns & show which column the data is returned from

  1. #1
    Registered User
    Join Date
    04-20-2012
    Location
    Shropshire
    MS-Off Ver
    Excel 2010
    Posts
    3

    Lookup multiple Columns & show which column the data is returned from

    Hi, I am using the following formula to Lookup multiple Columns if data is not found in column 1, but because some details have been duplicated in the tables I need to show which column the data is coming back from. How can I do this?

    =IFERROR(VLOOKUP(A2,'[Common Database.xlsx]Sheet1'!$A:$G,1,FALSE),IFERROR(VLOOKUP(B2,'[Common Database.xlsx]Sheet1'!$B:$G,1,FALSE),IFERROR(VLOOKUP(C2,'[Common Database.xlsx]Sheet1'!$C:$G,1,FALSE),"")))

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Lookup multiple Columns & show which column the data is returned from

    It is very difficult to work out what this formula does without the detailed sheets. Are you saying this formula returns data from a column, but you don't know which one? Is it possible to put a formula in another cell that tells you the column? Presumably you have 2 peices of data. one is the result, and the second is the column it came from.

  3. #3
    Registered User
    Join Date
    04-20-2012
    Location
    Shropshire
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Lookup multiple Columns & show which column the data is returned from

    I have a table with names, asset tags & serial numbers and am trying to compare my table with another teams to check we have the same but they use different names, so i am trying to then match on either asset or serial and return the name, but i need to define which field i actually got the match on as I know some details have been duplicated so i might return a different set of data to that I need.

    So If I get a match from one of the 3 column headings and my return each time is the server name ,I need to know which field I matched the data on?

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Lookup multiple Columns & show which column the data is returned from

    so there would be two results the value and the column where that value is...

    just an idea.. you can have a helper column of some sort that will tell you what column that value was.

    like:
    =IFERROR(VLOOKUP(A2,'[Common Database.xlsx]Sheet1'!$A:$G,1,FALSE)&""&"this is from column AA"
    ******
    there are formulas to return the column title but integrating it to your 3 lookup formula i think is not advisable.

    here,s a sample of getting the column title : got it from tiger--
    returns the column title...
    =IFERROR(INDEX($A$1:$K$1,,SMALL(IF(OFFSET($B$1:$K$1,MATCH($B$14,$A$2:$A$9,0),)="PASS",COLUMN($B$1:$K$1)),COUNTA($B$14:B14))),"")

    if you can pull this off you can integrate it with your 3 lookups..
    good luck.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  5. #5
    Registered User
    Join Date
    04-20-2012
    Location
    Shropshire
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Lookup multiple Columns & show which column the data is returned from

    [QUOTE=vlady;2765999]so there would be two results the value and the column where that value is...
    here,s a sample of getting the column title : got it from tiger--
    returns the column title...
    =IFERROR(INDEX($A$1:$K$1,,SMALL(IF(OFFSET($B$1:$K$1,MATCH($B$14,$A$2:$A$9,0),)="PASS",COLUMN($B$1:$K$1)),COUNTA($B$14:B14))),"")

    Thanks, but as a newbie to excel fomulas the formula is a bit of a minefield. What is the small wording ?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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