ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   function to vlookup and put between? (https://www.excelbanter.com/excel-worksheet-functions/244601-function-vlookup-put-between.html)

John

function to vlookup and put between?
 
Hi I have a simple table as follow

85 -3
65 -2
55 -1
50 0
45 1
35 2
15 3

I would like to have a formula or function that would allow me to assign a
value based on this table. For example if cell A2 = 47 then that falls
between 45 and 50 on the table and would get a value of 0. if cell A3 = 9
then it would be less than 15 and get a value of 3 (I am rounding down).
Does that make sense? Can someone help?

Domenic[_2_]

function to vlookup and put between?
 
Assuming that G2:H8 contains the lookup table, and A2 contains the
lookup value, try...

=INDEX(H2:H8,MATCH(A2,G2:G8,-1))

--
Domenic
Microsoft Excel MVP
www.xl-central.com
Your Quick Reference to Excel Solutions

In article ,
John wrote:

Hi I have a simple table as follow

85 -3
65 -2
55 -1
50 0
45 1
35 2
15 3

I would like to have a formula or function that would allow me to assign a
value based on this table. For example if cell A2 = 47 then that falls
between 45 and 50 on the table and would get a value of 0. if cell A3 = 9
then it would be less than 15 and get a value of 3 (I am rounding down).
Does that make sense? Can someone help?



All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com