need help creating formula

E

enixma

Does anyone know how to write a formula that will lookup a value and
return the next largest value?

For an example:

A B
1 100 120
2 200
3 300
4 400


I know the formula to return the value that's less than the value I am
looking up.
This is what I use =VLOOKUP(B1, A2:A4, 1, TRUE)
returns 100

How do I get it to return 200? Since 120 is between 100 and 200.

Any help is greatly appreciated!
 
N

Niek Otten

Sort your data in A descending (400,300,200,100).
Then use this formula:

=INDEX(A1:A4,MATCH(B1,A1:A4,-1))


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| Does anyone know how to write a formula that will lookup a value and
| return the next largest value?
|
| For an example:
|
| A B
| 1 100 120
| 2 200
| 3 300
| 4 400
|
|
| I know the formula to return the value that's less than the value I am
| looking up.
| This is what I use =VLOOKUP(B1, A2:A4, 1, TRUE)
| returns 100
|
| How do I get it to return 200? Since 120 is between 100 and 200.
|
| Any help is greatly appreciated!
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top