Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 83
Default VLookup that returns two separate cells instead of only one

Hello,

I have a table of 76 items (A2:D77). I want to key the item code into cell
F2 (of the same worksheet) and have Excel populate two pieces of data to the
right of F2 (this would be G2 and H2), that corresponds to the item code
typed in cell F2.

The original data is contained in A2:D77 so I have no problem doing this
when I use Vlookup but the formula only returns to data in the column I
specify, which is one column. I don't know how to write the formula to say I
want two pieces of data that correspond to "the value I enter" in the Vlookup.

I am sure what I've typed above is probably as clear as muddy water...

Thanks for any help you can offer, it is greatly appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,805
Default VLookup that returns two separate cells instead of only one

You are right, it is muddy :-)

Try this in G2
=VLOOKUP(F2,A2:D77,2,False) to get the value corresponding to the value
equal to F2 from the second column (B).

If you want the valued from the third colum in H2 then use
=VLOOKUP(F2,A2:D77,3,False)

If you want both in the same cell then use
=VLOOKUP(F2,A2:D77,2,False) & VLOOKUP(F2,A2:D77,3,False)

or

=VLOOKUP(F2,A2:D77,2,False) & " " & VLOOKUP(F2,A2:D77,3,False) if you want a
space in between

Does this makes sense?

"Jake" wrote:

Hello,

I have a table of 76 items (A2:D77). I want to key the item code into cell
F2 (of the same worksheet) and have Excel populate two pieces of data to the
right of F2 (this would be G2 and H2), that corresponds to the item code
typed in cell F2.

The original data is contained in A2:D77 so I have no problem doing this
when I use Vlookup but the formula only returns to data in the column I
specify, which is one column. I don't know how to write the formula to say I
want two pieces of data that correspond to "the value I enter" in the Vlookup.

I am sure what I've typed above is probably as clear as muddy water...

Thanks for any help you can offer, it is greatly appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default VLookup that returns two separate cells instead of only one

It depends on what columns in the table you want the results from.

If you want results from adjacent columns:

Results from columns C & D:

Entered in G2 and copied across to H2:

=VLOOKUP($F2,$A$2:$D$77,COLUMNS($A2:C2),0)

Results from columns B & C:

Entered in G2 and copied across to H2:

=VLOOKUP($F2,$A$2:$D$77,COLUMNS($B2:C2),0)

For results from non-adjacent columns:

Results from columns B & D:

Entered in G2 and copied across to H2:

=VLOOKUP($F2,$A$2:$D$15,2*COLUMNS($G2:G2),0)

--
Biff
Microsoft Excel MVP


"Jake" wrote in message
...
Hello,

I have a table of 76 items (A2:D77). I want to key the item code into
cell
F2 (of the same worksheet) and have Excel populate two pieces of data to
the
right of F2 (this would be G2 and H2), that corresponds to the item code
typed in cell F2.

The original data is contained in A2:D77 so I have no problem doing this
when I use Vlookup but the formula only returns to data in the column I
specify, which is one column. I don't know how to write the formula to
say I
want two pieces of data that correspond to "the value I enter" in the
Vlookup.

I am sure what I've typed above is probably as clear as muddy water...

Thanks for any help you can offer, it is greatly appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15
Default VLookup that returns two separate cells instead of only one

I think you are going to have to enter a vlookup in each cell where you are
wanting information returned. For example, in g2, enter

vlookup(f2,a2:d77,2,0),

then in h2 enter

vlookup(f2,a2:d77,3,0)

one other helpful hint would be to name your range (a2:d77) (lets say info
for example). That way, you can type vlookup(f2,info,2,0) and then copy the
formula down to other cells.


"Jake" wrote in message
...
Hello,

I have a table of 76 items (A2:D77). I want to key the item code into
cell
F2 (of the same worksheet) and have Excel populate two pieces of data to
the
right of F2 (this would be G2 and H2), that corresponds to the item code
typed in cell F2.

The original data is contained in A2:D77 so I have no problem doing this
when I use Vlookup but the formula only returns to data in the column I
specify, which is one column. I don't know how to write the formula to
say I
want two pieces of data that correspond to "the value I enter" in the
Vlookup.

I am sure what I've typed above is probably as clear as muddy water...

Thanks for any help you can offer, it is greatly appreciated.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
separate two dates from a text string into two separate cells Tacrier Excel Discussion (Misc queries) 3 October 13th 08 08:53 PM
VLOOKUP returns #N/A shannon c New Users to Excel 3 November 24th 07 01:16 AM
Separate first and second name in one cell into separate cells. Dwight in Georgia Excel Discussion (Misc queries) 3 January 25th 06 09:09 PM
VLOOKUP Returns #REF Michael Excel Worksheet Functions 3 September 19th 05 01:54 PM
Separate first and second name in one cell into separate cells. Gary's Student Excel Discussion (Misc queries) 0 April 27th 05 11:11 PM


All times are GMT +1. The time now is 06:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"