+ Reply to Thread
Results 1 to 4 of 4

VLOOKUP fot multiple returns

  1. #1
    Registered User
    Join Date
    07-29-2015
    Location
    Prague
    MS-Off Ver
    several version on different PCs
    Posts
    2

    VLOOKUP fot multiple returns


    Hi, i have big table with 60 000 rows. Example is in attachment (do not worry i used just 20 rows in example).
    pokusne vzorce.xlsx
    My 1st goal is to find ID ref/mut (column E) is sheet SNPs and return ref and mut allele.
    So far I worked with VLOOKUP and it was working for IDs with only one copy in sheet SNPs, problem is vlookup return only 1st value, so IDs with more copies in SNPs sheet are problematic.
    Is there any way how i can find all alternatives?

    p.s.
    sorry for my gramar, I know i have terrible writen english

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: VLOOKUP fot multiple returns

    Okay, so in Z2 of Sheet1, you want to return the first found sequence matching E2 from SNPs columnn C (ref allele). In AA2, it will be first instance but Column D from SNPs (alt allele). Yes?

    Then for the second instance that will happen (if there is one) in AB2 and AC2, and so on?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    07-29-2015
    Location
    Prague
    MS-Off Ver
    several version on different PCs
    Posts
    2

    Re: VLOOKUP fot multiple returns

    Quote Originally Posted by ChemistB View Post
    Okay, so in Z2 of Sheet1, you want to return the first found sequence matching E2 from SNPs columnn C (ref allele). In AA2, it will be first instance but Column D from SNPs (alt allele). Yes?

    Then for the second instance that will happen (if there is one) in AB2 and AC2, and so on?
    Yes, exactly.
    Is there any way how to do it?

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: VLOOKUP fot multiple returns

    Here's what I think is the most efficient way
    1. on SNPs, in F2 copied down
    =A2&"_"&COUNTIF($A$2:$A2,A2)
    This creates a unique ID for each sequence row. You can hide this column if you like

    2. In Sheet1 Z2 copied to the right and down

    =IFERROR(INDEX(SNPs!$C$2:$D$10002, MATCH($E2&"_"&INT((COLUMNS($A$1:A$1)-1)/2)+1,SNPs!$F$2:$F$10002,0),MOD(COLUMNS($A$1:A$1)-1,2)+1),"")


    This finds the unique identifier from F and returns first column C, then D, then C, then D
    Questions?
    Attached Files Attached Files

+ 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. Vlookup - multiple returns
    By surfsup00 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-23-2014, 12:12 PM
  2. Vlookup with Multiple returns
    By CSMPM in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-20-2013, 04:00 PM
  3. VLookup with multiple returns
    By Budro86 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-10-2013, 09:24 AM
  4. Vlookup with multiple returns
    By SITKAN in forum Excel General
    Replies: 1
    Last Post: 01-25-2010, 03:11 PM
  5. Multiple Returns with VLOOKUP?
    By hop17 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2009, 08:19 PM
  6. vlookup returns multiple value
    By panproblems in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-30-2008, 03:42 PM
  7. Vlookup Multiple Returns #REF
    By Ben in forum Excel General
    Replies: 3
    Last Post: 06-28-2005, 04: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