View Single Post
  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pete_UK Pete_UK is offline
external usenet poster
 
Posts: 8,856
Default vlookup returning a value in more than one cell

The value you want to match on is the pull-down that you have selected
in F6 - in column G you want to return the corresponding data from the
second column of your table and in column H you want data from the
third column of your table - in both cases matching on the data in
column A of the table. In your formula in H6, you are matching G6 with
what is in column B of your table, but you might have duplicates in
here and therefore might not match with the correct item (as VLOOKUP
picks up on the first entry which matches).

Another problem might be the size of your data table - you've got it
as A93:C101, but in your example you only quote values on rows 93 to
96. If you do not have data on all the rows in column B, then this
might explain why you get the #VALUE error.

Hope this helps.

Pete

On Jul 26, 4:56 pm, LTaylor wrote:
Sorry about that I didn't finish before it was sent

I have VLOOKUP(F6,Data!$A$93:$B$101,2,FALSE) in G6
I have VLOOKUP(G6,Data!$B$93:$C$101,2,FALSE) in H6
Do I have to name what is in column C the same that is in Column B and if so
can that be done? Right now I don't have C93, C94 etc named anything so I
don't know how it is referencing back to column B.

Like I mentioned before it is the darnest thing that it work fines for the
first row 93 and anything after row 95 but nothing for 94 and 95. Could
there be something in those cell that is making this not work?



"Pete_UK" wrote:
I think the first parameter in your VLOOKUP should be $F6, not G6 and
your table should cover Data!$A$93:$C$101. If you make these changes
to the formula in G6 then you can copy it to H6 and just change the
3rd parameter to 3 so you have two almost identical formulae:


G6: VLOOKUP($F6,Data!$A$93:$C$101,2,FALSE)
H6: VLOOKUP($F6,Data!$A$93:$C$101,3,FALSE)


Hope this helps.


Pete


On Jul 26, 4:18 pm, LTaylor wrote:
The strangest thing is happening. My formula is:
VLOOKUP(G6,Data!$B$93:$C$101,2,FALSE)


Column A Column B Column C
93 At Work description 1 Products 1
94 Youth Bank description 2 Products 2
95 Mobile ATM description 3 Products 3
96 IDA description 4
Products 4


B93 is named AtWork
B94 is named YouthBank
B95 is named MobileATM
b96 is named IDA


The cells is C are not named


When I go to my form spreadsheet if I choose "At Work" from my data
validation list in column F what I want in column G comes up and in column H.
At Work is the first on the list. Then if I pick the second or third thing
on the list, Youth Bank or Mobile ATM, it only fills in Column G and I get
#VALUE in column H. But if I pick any thing on the list after the third
item, like IDA, it works again.


I have tried everything to see if I have something in the cells C94 and C95
that are making invalid.
What am I doing wrong?


"Alan Beban" wrote:
Gord Dibben wrote:
You need two VLOOKUP formulas in two cells.


uh-uh.


=VLOOKUP(D2, $A$2:$C$3,2,FALSE) entered in E2


=VLOOKUP(D2, $A$2:$C$3,3,FALSE) entered in F2


You missed my post of 2:00pm? The equivalent of


=VLOOKUP(D2, $A$2:$C$3,{2,3},FALSE) array entered in E2:F2


Alan Beban- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -