Frage

Not sure if this is even possible, but before I write a script I wanted to ask... I have two columns in Excel, something like this:

 EC            Accession_ID
[3.1.1.1]   GRMZM2G057491_P01   
[2.1.1] GRMZM2G036921_P01   
[2.6.1.5]   GRMZM2G084279_P01   
[2.6.1.5]   GRMZM2G143767_P01

About 1,300 of those. Each EC corresponds to the Accession_ID in the same row. I have a list of Accession_IDs (roughly 800) that I'd want to replace with the matching EC number (using the list above) but they are not in the same order.

Is there a way to do this efficiently?

War es hilfreich?

Lösung

I'm afraid VLOOKUP would not suit in your case because the value to be looked up is to the left of the linking value. However INDEX and MATCH in combination should suit:

SO21737468 example

Assumes your two lists are in the same workbook (and on same sheet for the sake of the image).

Edit assuming different sheets and better image:

SO21737468 second example

Here Sheet1 ColumnA has been given the name EClist and Sheet1 ColumnB AccList.

Edit In view of your preference for VLOOKUP and given that I was wrong to expect someone else to have come along by now and offered that solution (again), I suggest copying ColumnA of Sheet1 to ColumnC and in B1 of your (assumed) other sheet:

=VLOOKUP(A1,Sheet1!B:C,2,0)  

copied down to suit.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top