If between then VLOOKUP

osf9

New Member
Joined
Sep 6, 2012
Messages
20
Dear all,

I'm looking for a smart formula to test if a number is between a range of 2 other number and then I need a susequent VLOOKUP to report on the other spreadsheet the value I need.

Just to explain in a better way with an example:

Value StartValue EndText
15Good
610Poor
1115Awesome

<tbody>
</tbody>

Now, I have another table where I have:

ValueVLookup
2
7
13

<tbody>
</tbody>

I need to include the Vlookup column the Text related to the range in the first table.

Thanks in advance, best regards, Carlo
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Dear all,

I'm looking for a smart formula to test if a number is between a range of 2 other number and then I need a susequent VLOOKUP to report on the other spreadsheet the value I need.

Just to explain in a better way with an example:

Value StartValue EndText
15Good
610Poor
1115Awesome

<tbody>
</tbody>

Now, I have another table where I have:

ValueVLookup
2
7
13

<tbody>
</tbody>

I need to include the Vlookup column the Text related to the range in the first table.

Thanks in advance, best regards, Carlo


If we say your first range (the one to lookup in) has the name "Ratings" then

Code:
=vlookup(A1;Ratings;2;TRUE)


That code should go into B1 in your second range (the one with the values to lookup)


Best regards
 
Upvote 0
Sorry, not clear how this formula can understand if value is between start and end.
 
Upvote 0
Here you go, no need for VLOOKUP.

Leandrial was telling you to use "TRUE" for the last function of the VLOOKUP formula which finds an approximate match. It would work sometimes, but if you had a number right in the middle of two then I don't know which one it would pick.

efnX7wf.jpg
 
Last edited:
Upvote 0
Sorry, not clear how this formula can understand if value is between start and end.

What it does is that it looks in your first range, first column for a match to the number you are searching for... Ive statet that it should look for approximate match... That works as follows...

If the search number is say 7, it looks for that number... If it can find 7, it returns from the row... If it cant find 7, it goes through the values, top from buttom, until it find a value that is greater then 7 (in your list 10)... Since its already looking at 10, the row before that has had to be less then 7, since it didnt match... So now the search "nows" that the searchvalue is between the number of the cell it is looking at (10) and greater then the value of the row before (6 in your list)...
And the rule for the search is that if it cant find an exact match, it has to choose the value as close to, but lesser then the search value (6 in your case)... Then it return the value of column 2 in the row that has the value 6 in the first cell...

Does that make sense??

And btw, you didnt tell me if the formula worked for you?? Have you tried it?+

Best regards

Leandrial
 
Upvote 0
Here you go, no need for VLOOKUP.

Leandrial was telling you to use "TRUE" for the last function of the VLOOKUP formula which finds an approximate match. It would work sometimes, but if you had a number right in the middle of two then I don't know which one it would pick.

efnX7wf.jpg

It always looks "down" to lesser value

:)

Best regards

Leandrial
 
Upvote 0
So even the value "9" would be returned with lookup from row with "6" value in it...

So no need not to use VLOOKUP

:)

Best regards

Leandrial
 
Upvote 0
Here you go, no need for VLOOKUP.

Leandrial was telling you to use "TRUE" for the last function of the VLOOKUP formula which finds an approximate match. It would work sometimes, but if you had a number right in the middle of two then I don't know which one it would pick.

efnX7wf.jpg

And to be honest, how smart is it to tell someone to use a looooong IF-statement, in stead of a very short vlookup, based on the fact that you "dont know" if my vlookup would work.. had you bothered to learn something by testing what i wrote, before you startet handing out advice, you would have saved all 3 of us something... Me some grievens, the osf9 and yourself some time..
 
Upvote 0
So even the value "9" would be returned with lookup from row with "6" value in it...

So no need not to use VLOOKUP

:)

Best regards

Leandrial

This is correct, but i think you should use 3 instead of 2 since the searched value is in the 3rd column.

=vlookup(A1;Ratings;2;TRUE)

And maybe OP's Excel version uses , (comma) as argument separator instead of ; (semicolon)

So assuming the data in columns A, B and C, maybe something like this



A

B

C

D

E

F

1

Value Start​

Value End​

Text​

Value​

VLookup​

2

1​

5​

Good​

2​

Good​

3

6​

10​

Poor​

7​

Poor​

4

11​

15​

Awesome​

13​

Awesome​

<TBODY>
</TBODY>


Formula in F2 copied down
=VLOOKUP(E2,$A:$C,3,1)

Hope this helps

M.
 
Upvote 0
This is correct, but i think you should use 3 instead of 2 since the searched value is in the 3rd column.
And maybe OP's Excel version uses , (comma) as argument separator instead of ; (semicolon)

So assuming the data in columns A, B and C, maybe something like this


A
B
C
D
E
F
1
Value Start​
Value End​
Text​
Value​
VLookup​
2
1​
5​
Good​
2​
Good​
3
6​
10​
Poor​
7​
Poor​
4
11​
15​
Awesome​
13​
Awesome​

<tbody>
</tbody>


Formula in F2 copied down
=VLOOKUP(E2,$A:$C,3,1)

Hope this helps

M.


OHHHH sorry.... ofc the column would be 3.... A typo on my behalf....

Best regards

Leandrial
 
Upvote 0

Forum statistics

Threads
1,221,446
Messages
6,159,917
Members
451,603
Latest member
SWahl

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top