ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   lookup a value in a table (https://www.excelbanter.com/excel-discussion-misc-queries/157248-lookup-value-table.html)

saintsalive

lookup a value in a table
 
I need to lookup a value in a table, using the first 2 columns as a range,
then return the approp value from the 3rd column. For example lookup 8, as it
falls between 7 and 9, I want to return e. 18 would give me m as would 25.
col1 col2 col3
1 6 q
7 9 e
11 25 m

Max

lookup a value in a table
 
Assuming the source lookup table is in A1:C3,
lookup value (eg: 8) in E1

Place in F1, array-enter (press Ctrl+Shift+Enter to confirm the formula):
=INDEX(C1:C3,MATCH(1,(E1=A1:A3)*(E1<=B1:B3),0))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"saintsalive" wrote:
I need to lookup a value in a table, using the first 2 columns as a range,
then return the approp value from the 3rd column. For example lookup 8, as it
falls between 7 and 9, I want to return e. 18 would give me m as would 25.
col1 col2 col3
1 6 q
7 9 e
11 25 m


PCLIVE

lookup a value in a table
 
One way:

=INDIRECT("C" & SUMPRODUCT(--(A1:A3<=D1),--(B1:B3=D1),ROW(C1:C3)))

D1 contains the value to look up. Change as needed.

HTH,
Paul

--

"saintsalive" wrote in message
...
I need to lookup a value in a table, using the first 2 columns as a range,
then return the approp value from the 3rd column. For example lookup 8, as
it
falls between 7 and 9, I want to return e. 18 would give me m as would
25.
col1 col2 col3
1 6 q
7 9 e
11 25 m




saintsalive

lookup a value in a table
 
Thanx

"Max" wrote:

Assuming the source lookup table is in A1:C3,
lookup value (eg: 8) in E1

Place in F1, array-enter (press Ctrl+Shift+Enter to confirm the formula):
=INDEX(C1:C3,MATCH(1,(E1=A1:A3)*(E1<=B1:B3),0))
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"saintsalive" wrote:
I need to lookup a value in a table, using the first 2 columns as a range,
then return the approp value from the 3rd column. For example lookup 8, as it
falls between 7 and 9, I want to return e. 18 would give me m as would 25.
col1 col2 col3
1 6 q
7 9 e
11 25 m


Max

lookup a value in a table
 
welcome
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"saintsalive" wrote in message
...
Thanx





All times are GMT +1. The time now is 10:14 AM.

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