how to get Nearest higher value

snjpverma

Well-known Member
Joined
Oct 2, 2008
Messages
1,585
Office Version
  1. 365
Platform
  1. Windows
the data in Column G is in ascending order and I want the number from Column G which is closest to the value in A2 as my return value.

the below lookup function gives me the closest lower value only. Please advise me how to get the closest higher value.

=LOOKUP(A2,G:G)
 
Last edited:

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hey snjpverma,

You could use an ARRAY formula
Code:
=INDEX(G:G,MATCH(MIN(ABS(G:G-A2)),ABS(G:G-A2),0))

Remember paste in the formula, and then hit CTRL+SHIFT+ENTER to create an array formula {}

Hope that helps
Caleeco
 
Upvote 0
Hi Caleeco,
I tried Your formula and it gives me the nearest lower value instead of the higher one
 
Upvote 0
I tried the below but it doesn't work either. it seems to work only in Descending order. but my data is in ascending.

=INDEX(G:G,MATCH(A2,G:G,-1))
 
Last edited:
Upvote 0
Hi,

Try this:

=INDEX(G:G,MATCH(A2,G:G,0)+1)
 
Upvote 0
Hi Caleeco,
I tried Your formula and it gives me the nearest lower value instead of the higher one

Strange. Works on my test sheet.

Do you want the Nearest value? or the Nearest-Highest Value?

Caleeco
 
Upvote 0
If it's possible that the value in A2 is not always an exact match for a value in G try:
Excel Workbook
ABCG
146
220423775
378
494
5102
6108
7167
8194
9237
10270
11308
12328
13330
14337
15383
16393
17404
18420
Sheet
 
Upvote 0
Try either of the following


Excel 2010
ABCD
2204237237
9b
Cell Formulas
RangeFormula
D2=AGGREGATE(15,6,1/($G$1:$G$18>A2)*$G$1:$G$18,1)
C2{=MIN(IF($G$1:$G$18>=$A2,$G$1:$G$18))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,853
Members
452,361
Latest member
d3ad3y3

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