ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VLookup only calling one cell (https://www.excelbanter.com/excel-discussion-misc-queries/203338-vlookup-only-calling-one-cell.html)

Alexander

VLookup only calling one cell
 
Hello,
I am trying to use vlookup to search for a temperature within the following
data and return the corresponding "hot" or "cold."

t1 t2 stream
20 135 cold
170 60 hot
150 80 cold
50 140 hot

THE RESULT:

T Ti
170 hot
150 cold
140 cold
135 cold
80 cold
60 cold
50 cold
20 cold

After the first temperature (170), the formula is only returning the
top"cold" (C3) within the above table. Here is my formula:
=VLOOKUP(A8,$A$2:$C$5,3)

Is there something about the vlookup function I am missing? Any help is
much appreciated, thank you.

Pete_UK

VLookup only calling one cell
 
You need to sort your first table.

Hope this helps.

Pete


On Sep 21, 8:25*pm, Alexander
wrote:
Hello,
I am trying to use vlookup to search for a temperature within the following
data and return the corresponding "hot" or "cold."

t1 * * *t2 * * *stream
20 * * *135 * * cold
170 * * 60 * * *hot
150 * * 80 * * *cold
50 * * *140 * * hot

THE RESULT:

T * * * Ti
170 * * hot
150 * * cold
140 * * cold
135 * * cold
80 * * *cold
60 * * *cold
50 * * *cold
20 * * *cold

After the first temperature (170), the formula is only returning the
top"cold" *(C3) within the above table. *Here is my formula: *
=VLOOKUP(A8,$A$2:$C$5,3)

Is there something about the vlookup function I am missing? *Any help is
much appreciated, thank you.



FSt1

VLookup only calling one cell
 
hi
your raw data must be sorted in assencing order.

Regards
FSt1

"Alexander" wrote:

Hello,
I am trying to use vlookup to search for a temperature within the following
data and return the corresponding "hot" or "cold."

t1 t2 stream
20 135 cold
170 60 hot
150 80 cold
50 140 hot

THE RESULT:

T Ti
170 hot
150 cold
140 cold
135 cold
80 cold
60 cold
50 cold
20 cold

After the first temperature (170), the formula is only returning the
top"cold" (C3) within the above table. Here is my formula:
=VLOOKUP(A8,$A$2:$C$5,3)

Is there something about the vlookup function I am missing? Any help is
much appreciated, thank you.


JMB

VLookup only calling one cell
 
vlookup has an optional fourth parameter to specify an exact match versus an
approximate match
=VLOOKUP(A8,$A$2:$C$5,3,FALSE)

vlookup will attempt to match A8 to A2:A5 and return the corresponding value
from column C. I notice some of the values in your table are in column B -
vlookup won't match A8 to column B with the formula as it is written. If
that is your intent, you could try

=If(IsNumber(Match(A8,A2:A5,0)), Vlookup(A8, A2:C5, 3, False), Vlookup(A8,
B2:C5, 2, False))


"Alexander" wrote:

Hello,
I am trying to use vlookup to search for a temperature within the following
data and return the corresponding "hot" or "cold."

t1 t2 stream
20 135 cold
170 60 hot
150 80 cold
50 140 hot

THE RESULT:

T Ti
170 hot
150 cold
140 cold
135 cold
80 cold
60 cold
50 cold
20 cold

After the first temperature (170), the formula is only returning the
top"cold" (C3) within the above table. Here is my formula:
=VLOOKUP(A8,$A$2:$C$5,3)

Is there something about the vlookup function I am missing? Any help is
much appreciated, thank you.



All times are GMT +1. The time now is 10:20 PM.

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