Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 67
Default LOOKUP the number higher not lower

I have a problem I'm trying to put together a spreadsheet and need the lookup
command, the lookup command is designed to look at the numbers in the table
and find the one that is the same or the next one down from what you are
looking for. What I need is to get it to look up the same number or the next
number up from the one Im looking for. Can someone help me on how to get that
done.

Thanks In Advance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 266
Default LOOKUP the number higher not lower

How about copying the list in another column - but upside down. Then when
you search it will find the "lower" number. To copy the list upside down -
copy it into another column and then set a column to the left of the copied
column (for example column "K") with the numbers from 1 to whatever. Then
sort those 2 columns on column "K" descending. Maybe someone has a better
idea if that doesn't work for you.


"Ivan" wrote:

I have a problem I'm trying to put together a spreadsheet and need the lookup
command, the lookup command is designed to look at the numbers in the table
and find the one that is the same or the next one down from what you are
looking for. What I need is to get it to look up the same number or the next
number up from the one Im looking for. Can someone help me on how to get that
done.

Thanks In Advance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 33
Default LOOKUP the number higher not lower

Ivan,

If I'm reading this right, you want to return the exact match if it exists
and the next higher number if the exact match doesn't exist. To do that, we
can use the good old OFFSET function combined with a MATCH. The MATCH
statement will allow you to find the next higher number. In this formula,
we'll just check to see if the exact match exists. If it does, we'll use it.
If not, we'll use the OFFSET and MATCH to get the next higher number.

Assuming your list of numbers is sorted from low to high and is in A1:A100
and the number you want to find is in C2, then use:

=IF(ISERROR(VLOOKUP(C2,$A$1:$A$100,0)),OFFSET($A$1 ,MATCH(C2,$A$1:$A$100,1),0),VLOOKUP(C2,$A$1:$A$100 ,0))

--
Happy calculating!

If you like this answer, please click ''Yes.''




"Ivan" wrote:

I have a problem I'm trying to put together a spreadsheet and need the lookup
command, the lookup command is designed to look at the numbers in the table
and find the one that is the same or the next one down from what you are
looking for. What I need is to get it to look up the same number or the next
number up from the one Im looking for. Can someone help me on how to get that
done.

Thanks In Advance.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default LOOKUP the number higher not lower

Assuming the lookup value will not be greater than the max value in your
lookup table.

Try this array formula** :

A2:B15 = lookup table

D2 = lookup value

=INDEX(B2:B15,MATCH(MIN(IF(A2:A15=D2,A2:A15)),A2: A15,0))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"Ivan" wrote in message
...
I have a problem I'm trying to put together a spreadsheet and need the
lookup
command, the lookup command is designed to look at the numbers in the
table
and find the one that is the same or the next one down from what you are
looking for. What I need is to get it to look up the same number or the
next
number up from the one Im looking for. Can someone help me on how to get
that
done.

Thanks In Advance.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select range higher than and lower than Kasper Excel Discussion (Misc queries) 6 October 23rd 08 02:58 PM
LOOKUP and higher value jonrtait Excel Discussion (Misc queries) 4 November 2nd 06 12:03 PM
Can I flag numbers that are higher/lower than a range of #'s Rick Parker Excel Worksheet Functions 1 July 8th 06 01:56 AM
need to select closest match using vlookup if it higher or lower vlookup help pls Excel Discussion (Misc queries) 1 March 1st 06 07:30 PM
How can I find the row nr of the first number lower/ higher then a vmv Excel Discussion (Misc queries) 3 February 9th 05 02:03 AM


All times are GMT +1. The time now is 09:37 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"