Find nearest value in a column based on a criteria

uttamsaxena

Board Regular
Joined
Apr 22, 2003
Messages
182
I have a table to find a data value. In one cell A1 a number between 1 to 15 is selected and in another cell A2 a value is typed. Suppose A1 = 14 and A2 = 176482.

Now the objective is to find the exact or next higher value as given in A2 in the column with top row value 14 form the table. Here Column with header 14 don't have exact value as in A2. So It must output next higher value in column 14 ie 177400 in output cell A3. Can one help with a formula for cell A3.

123456789101112131415
199001700224002720029800368004490047600531005610067700123100131100144200171400
205001800231002800030700379004620049000547005780069700126800135000148500176500
211001900238002880031600390004760050500563005950071800130600139100153000181800
217002000245002970032500402004900052000580006130074000134500143300157600187300
224002100252003060033500414005050053600597006310076200138500147600162300192900
231002200260003150034500426005200055200615006500078500142700152000167200198700
238002300268003240035500439005360056900633006700080900147000156600172200204700
245002400276003340036600452005520058600652006900083300151400161300177400210800
252002500284003440037700466005690060400672007110085800155900166100182700
260002600293003540038800480005860062200692007320088400160600171100188200
268002700302003650040000494006040064100713007540091100165400176200193800
276002800311003760041200509006220066000734007770093800170400181500199600
284002900320003870042400524006410068000756008000096600175500186900205600
293003000330003990043700540006600070000779008240099500180800192500211800
3020031003400041100450005560068000721008020084900102500186200198300218200
3110032003500042300464005730070000743008260087400105600191800204200
3200033003610043600478005900072100765008510090000108800197600210300
3300034003720044900492006080074300788008770092700112100203500216600
3400035003830046200507006260076500812009030095500115500209600
3500036003940047600522006450078800836009300098400119000215900
36100370040600490005380066400812008610095800101400122600
37200380041800505005540068400836008870098700104400126300
383003900431005200057100705008610091400101700107500130100
394004000444005360058800726008870094100104800110700134000
406004100457005520060600748009140096900107900114000138000
418004200471005690062400770009410099800111100117400142100
4310043004850058600643007930096900102800114400120900146400
4440044005000060400662008170099800105900117800124500150800
45700450051500622006820084200102800109100121300128200155300
47100460053000641007020086700105900112400124900132000160000
48500470054600660007230089300109100115800128600136000164800
50000480056200680007450092000112400119300132500140100169700
51500490057900700007670094800115800122900136500144300174800
53000500059600721007900097600119300126600140600148600180000
546005200614007430081400100500122900130400144800153100185400
562005400632007650083800103500126600134300149100157700191000
579005600651007880086300106600130400138300153600162400196700
596005800671008120088900109800134300142400158200167300202600
614006000691008360091600113100138300146700162900172300208700
632006200712008610094300116500142400151100167800177500

<tbody>
</tbody>
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
hi,

Considering your data is in range (A5:O44) use following array formula in Cell A3

=MIN(IF((((A4:O4=$A$1)*(A5:O44)<>0)+((A5:O44)>=$A$2))=2,(A5:O44),"False"))

Please Press Ctrl+Shift+Enter and not only Enter.

One point to highlight is there is the output comes as Zero (0) , please note that there is no value in the provided column which matches given criteria.

Thanks

Swapnil Shah
 
Upvote 0
I have a table to find a data value. In one cell A1 a number between 1 to 15 is selected and in another cell A2 a value is typed. Suppose A1 = 14 and A2 = 176482.

Now the objective is to find the exact or next higher value as given in A2 in the column with top row value 14 form the table. Here Column with header 14 don't have exact value as in A2. So It must output next higher value in column 14 ie 177400 in output cell A3. Can one help with a formula for cell A3.

[...]

Let A1:O41 of Sheet1 house the data.

A1 of Sheet2 houses a relative column indicator like 14.

A2 of Sheet2 houses a look up value like 176482.

In A3 of Sheet2 enter:

=INDEX(Sheet1!$A$2:$O$41,MATCH(A2,INDEX(Sheet1!$A$2:$O$41,0,A1),1)+(VLOOKUP(A2,INDEX(Sheet1!$A$1:$O$41,0,MATCH(A1,INDEX(Sheet1!$A$1:$O$41,1,0),0)),1,1) < A2),A1)
 
Upvote 0
hi,

Considering your data is in range (A5:O44) use following array formula in Cell A3

=MIN(IF((((A4:O4=$A$1)*(A5:O44)<>0)+((A5:O44)>=$A$2))=2,(A5:O44),"False"))

Please Press Ctrl+Shift+Enter and not only Enter.

One point to highlight is there is the output comes as Zero (0) , please note that there is no value in the provided column which matches given criteria.

Thanks

Swapnil Shah

Thanks for your help but somehow it is returning zero with the given example.
 
Upvote 0
Let A1:O41 of Sheet1 house the data.

A1 of Sheet2 houses a relative column indicator like 14.

A2 of Sheet2 houses a look up value like 176482.

In A3 of Sheet2 enter:

=INDEX(Sheet1!$A$2:$O$41,MATCH(A2,INDEX(Sheet1!$A$2:$O$41,0,A1),1)+(VLOOKUP(A2,INDEX(Sheet1!$A$1:$O$41,0,MATCH(A1,INDEX(Sheet1!$A$1:$O$41,1,0),0)),1,1) < A2),A1)
Thanks Aladin, it is working perfectly.
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,695
Members
449,117
Latest member
Aaagu

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