vlookup returning first value

johnny52

Active Member
Joined
Oct 13, 2006
Messages
333
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
I have a small worksheet for an example 3 columns,6 rowss

col a1=1 a2=1 a3=1 a4=2 a5=2 a6=2
col b1=1 b2=2 b3=3 b4=1 b5=2 b6=3
col c1=1 c2=1 c3=1 c4=1 c5=2 c6=2

my vlookup formula in column D =vlookup(c1,$a$1:$b$10,2,false),"")
returns all 1's in col d1 through d6.....it's returning first value it finds from col B

the values in col b are not always numbers.......was wondering if there was an index match that might work

Thanks Everybody
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
How about


Excel 2013/2016
ABCD
11111
21221
31312
42113
52222
62323
Indata
Cell Formulas
RangeFormula
D1=INDEX($B$1:$B$6,AGGREGATE(15,6,(ROW($A$1:$A$6)-ROW($A$1)+1)/($A$1:$A$6=C1),COUNTIF($C$1:$C1,C1)))
 
Upvote 0
What version of Xl are you using?
 
Upvote 0
Ok, Aggregate didn't come in until 2010, try


Excel 2013/2016
ABCD
11111
21221
31312
42113
52222
62323
Indata
Cell Formulas
RangeFormula
D1{=INDEX($B$1:$B$6,SMALL(IF(($A$1:$A$6=C1),ROW($A$1:$A$6)-ROW($A$1)+1),COUNTIF($C$1:$C1,C1)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
That did the trick THANKS SO MUCH.......didn't notice your first response did show the example for 2013 2016
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
what happened to the original reply from this earlier post ? The Array formula is buried in there somewhere Thanks
 
Upvote 0
It's a problem with the HTML that was allowed on the previous board, but not here. It will be sorted out, but will take some time.

I suspect the formula was
=INDEX($B$1:$B$6,SMALL(IF($A$1:$A$6=C1),ROW($A$1:$A$6)-ROW($A$1)+1),COUNTIF($C$1:$C1,C1)))
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,312
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top