+ Reply to Thread
Results 1 to 7 of 7

Matching when values are in several possible columns

Hybrid View

  1. #1
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Matching when values are in several possible columns

    Hi Everyone,

    I'm having trouble coming up with a code for matching one name to several columns, one of which will contain the matching name. To explain better, I have a spreadsheet with birds that have indentifying rings. One ring is metal, the other plastic. The plastic was the easiest to read so that was how birds were recorded. Unfortunately the plastic ring would become difficult to read over time and have to be replaced. Thus, one bird could be recorded under several different plastic ring codes. I now want to match the bird recorded as one of it's possible plastic ring codes to its metal code - and include additional information in adjacent columns. I can do this easily for matching one column (eg:Plastic 1) to the list of observations (shown in spreadsheet, J to L), it's including all possible names (Plastic 2, Plastic 3) where I'm having trouble.

    So in summary, I need to change the formuals in columns J, K, and L to include columns G and H in addition to F. Can anyone suggest a fix? (the name in column J isn't important, just it's placement in the correct row).

    Thanks!
    G
    Attached Files Attached Files

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: Matching when values are in several possible columns

    Hi mgreg,

    Welcome to the forum.

    I have added row 18 into the data and formula showed the results in column J,K,L.. what else do you need?

    Match example.xlsx
    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Matching when values are in several possible columns

    Hi Dilipandey,

    Thank-you very much for taking the time to help, it's very much appreciated! Unfortunately I didn't explain myself very well. I need the formulas in columns J,K, and L to be able to match up to ring codes in columns G and H in addition to F. So for example, both YB:AJJ and GW:MO were observed on March 12. At the time of observation YB:AJJ was 6-48757's only plastic code so it is listed in column F, but GW:MO was 6-48765's second ring code so it is listed in column G. So the formula would have to be able to match to each name regardless of which column (F, G, or H) it is listed in. Do you think there is a solution?

    Cheers,
    G

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Matching when values are in several possible columns

    will there ever be matches in more than one column for the same row? if there won't then you can use
    =SUMPRODUCT(($A$3:$A$17=F3:H3)*ROW($A$3:$A$17))
    to get the matching row number (or 0 for no match) and then use that in INDEX formulas to pull the data you want.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  5. #5
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Matching when values are in several possible columns

    Hi JP, There won't ever be matches in more than one column for the same row. Your formula works great but I'm lost at the next step. I can't get excel to recognize that the value given in your formula corresponds to a row number

  6. #6
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Matching when values are in several possible columns

    say that formula is in O3, in L3
    =INDEX(A:A,$O3)
    and copy across.

  7. #7
    Registered User
    Join Date
    06-10-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Matching when values are in several possible columns

    Hi JP, this works! Because the second formula (column K) still gives a bird if the first formula (column J) gives a zero instead of a row number (i.e., the bird was not actually observed), i added a numbered column (I). I then sorted Column J, deleted all records with 0, then sorted Column I to put everything back right. It gives exactly what i want. Thanks!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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