Combo Box - How to Use Output in Vlookup

  • Thread starter Thread starter opieandy
  • Start date Start date
O

opieandy

I've created a combo box and linked its output to a cell. I'm using that
cell in a vlookup formula. Using the combo box blows the vlookup formula.

The cell is formatted correctly (as a number), though the number doesn't
line up with the numbers below it (which aren't yet linked to a combo box),
and format painter does not change it to match those cells, so that tells me
there's something screwy about the format, but still not sure why vlookup
won't recognize it.

Any help/thoughts/ideas?

Thanks,

Chris
 
Its probably a text number.
You can try an "add zero" to the lookup, eg: = VLOOKUP(A2+0, ...)
which will coerce the text num in A2 to a real num for proper matching
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
 
The combobox produces text, not a number.

in the vlookup put a VALUE function pointing to the linked cell.

=vlookup(Value(A1),.......)
 
If your linkedcell is A1, try:

=isnumber(a1)

You'll see that the value in that cell is text--that's what the combobox
contains.

If all you have for options in that combobox are numbers (er, text values that
look like numbers), then maybe you could use:

=vlookup(--a1,sheet2!a:b,2,false)

The -- will coerce the text number to a number number.
 
Everyone - thanks for your help!

Chris

Dave Peterson said:
If your linkedcell is A1, try:

=isnumber(a1)

You'll see that the value in that cell is text--that's what the combobox
contains.

If all you have for options in that combobox are numbers (er, text values that
look like numbers), then maybe you could use:

=vlookup(--a1,sheet2!a:b,2,false)

The -- will coerce the text number to a number number.
 
Back
Top