View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Miguel Zapico Miguel Zapico is offline
external usenet poster
 
Posts: 95
Default Compare to table

This is a good scenario for VLOOKUP, using your layout of A1:B50, and
assuming that the A column is sorted (it looks like that in your post), the
formula to use can be:
=VLOOKUP(222,$A$1:$B$50,2)
You can change the first number to a cell reference. For example, if you
have your 1000 numbers in cells D1:D1000, you can put this formula in cell E1
=VLOOKUP(D1,$A$1:$B$50,2)
And drag it all over the column E.

Regarding the $, check the help for "cell and range references", it explains
the meaning of the sign better than I can do.

Miguel.

"spxer" wrote:


I have over 1000 cells to compare to over 50 values. lets say A1:A50 is
values of 100 through 10,045, but not evenly divided (can't make this
easy or anyone could do it, even me.) b1:b50 is 1 through 50. Now I
have a coulmn of 1000 numbers to associate with the table a,b. Find the
number in column "a" that is less than the number in question but the
next number down is greater. then return the coresponding number in
column b. IE; say the number to compare is 222. in table a,b we find a
number series .....a5=201, a6=220, a7=235..... a5 or 220 is the correct
asociation. and b6 is returned.
Miguel, What is your reference to $ called? I could not find this in
help.
Thanks again and all for any help.


--
spxer
------------------------------------------------------------------------
spxer's Profile: http://www.excelforum.com/member.php...o&userid=37025
View this thread: http://www.excelforum.com/showthread...hreadid=567497