View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default vLookUp return several columns?

You could fiddle with multicelled array formula--or use multiple =vlookup()'s.

But I've found that the quickest way is to use a column to return the row of the
match and then use that in other cells in the other columns that retrieves the
data.

=match(a2,sheet2!a:a,0)
(say this is in G2)

This will return an error if there is not a match. It will return the number of
the first row of the matching cell if there is a match.

Then in the subsequent columns, I could use this in H2:
=if(iserror($g2),"",index(sheet2!b:b,$g2))
and drag to the right to return the neighboring cell values.

Using tons and tons of =vlookup()'s (against giant tables) will slow down excel
each time they need to be calculated.



General Fear wrote:

Vlookup only returns one column that matches the value searched. I
wanted to return several columns, otherwise, I am forced to use
vlookup for each column.

Below is an example

Customer ID, Customer Name, Address1, Address2, City, State, Zip

If I match on Customer ID, then I want name, address, city, state zip
in one shot.

Is this possible?


--

Dave Peterson