VLookUp and Match the nearest value.

vivienne3608

New Member
Joined
Sep 10, 2014
Messages
17
Hello everyone,

How do I use VLookUp and Match (or any other excel formula) to return the nearest value from a range of values? The answer will be in cell H5. I need excel to use cells H2 and H3 as the search criteria to find the closest value equal to or above the value in cell H4. The table is cells A1:E15. I know there is sometimes more than one equal answer but I need to know the value it doesn't matter how many times it appears. I hope the fact there are more than one cell with the same answer doesn't mean excel can't perform what I need it to.

I appreciate any help with this. Thanks.

A</SPAN>B</SPAN>C</SPAN>D</SPAN>E </SPAN>F</SPAN>G</SPAN>H</SPAN>
1</SPAN>1</SPAN>2</SPAN>3</SPAN>4</SPAN>
2</SPAN>Top</SPAN>£37,930</SPAN>£39,830</SPAN>£41,830</SPAN>£44,130</SPAN>Group</SPAN>Bottom</SPAN>
3</SPAN>Top</SPAN>£37,930</SPAN>£39,830</SPAN>£41,830</SPAN>£44,130</SPAN>Stage</SPAN>2</SPAN>
4</SPAN>Top</SPAN>£37,245</SPAN>£39,145</SPAN>£41,045</SPAN>£43,345</SPAN>Current Amount</SPAN>£30,941</SPAN>
5</SPAN>Top</SPAN>£36,459</SPAN>£38,359</SPAN>£40,259</SPAN>£42,559</SPAN>Proposed Amount</SPAN> ?
6</SPAN>Top</SPAN>£35,774</SPAN>£37,574</SPAN>£39,374</SPAN>£41,674</SPAN>
7</SPAN>Top</SPAN>£34,988</SPAN>£36,688</SPAN>£38,488</SPAN>£40,688</SPAN>
8</SPAN>Top</SPAN>£34,988</SPAN>£36,688</SPAN>£38,488</SPAN>£40,688</SPAN>
9</SPAN>Bottom</SPAN>£33,334</SPAN>£34,834</SPAN>£36,534</SPAN>£38,634</SPAN>
10</SPAN>Bottom</SPAN>£33,334</SPAN>£34,834</SPAN>£36,534</SPAN>£38,634</SPAN>
11</SPAN>Bottom</SPAN>£32,758</SPAN>£34,158</SPAN>£35,758</SPAN>£37,858</SPAN>
12</SPAN>Bottom</SPAN>£32,182</SPAN>£33,582</SPAN>£35,082</SPAN>£37,182</SPAN>
13</SPAN>Bottom</SPAN>£31,507</SPAN>£32,807</SPAN>£34,007</SPAN>£35,907</SPAN>
14</SPAN>Bottom</SPAN>£30,931</SPAN>£32,031</SPAN>£33,131</SPAN>£34,731</SPAN>
15</SPAN>Bottom</SPAN>£30,931</SPAN>£32,031</SPAN>£33,131</SPAN>£34,731</SPAN>

<TBODY>
</TBODY><COLGROUP><COL><COL><COL span=5><COL><COL></COLGROUP>
 
Second formula has a typo... should be:

=IFERROR(OFFSET($A$2,MATCH($H$3,CHOOSE(MATCH($H$2,$B$2:$E$2,0),B3:B16,C3:C16,D3:D16,E3:E16),0),),"-")

If your excel version is > 2007
 
Upvote 0

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Good morning all,

I hope someone can help again with this, the following formula works:

=MIN(IF('Data Sheet'!BO5:BO61=B9,IF('Data Sheet'!BQ4:BT4=H3,IF('Data Sheet'!BQ5:BT61>=E7,'Data Sheet'!BQ5:BT61))))

However, if there is not a value higher it returns a N/A. How do I get the formula to select the highest figure in the range if there is not one higher than the value required.

I hope that makes sense.

Viv
 
Upvote 0
Good morning all,

I hope someone can help again with this, the following formula works:

=MIN(IF('Data Sheet'!BO5:BO61=B9,IF('Data Sheet'!BQ4:BT4=H3,IF('Data Sheet'!BQ5:BT61>=E7,'Data Sheet'!BQ5:BT61))))

However, if there is not a value higher it returns a N/A. How do I get the formula to select the highest figure in the range if there is not one higher than the value required.

I hope that makes sense.

Viv

Hello everyone,

How do I use VLookUp and Match (or any other excel formula) to return the nearest value from a range of values? The answer will be in cell H5. I need excel to use cells H2 and H3 as the search criteria to find the closest value equal to or above the value in cell H4. The table is cells A1:E15. I know there is sometimes more than one equal answer but I need to know the value it doesn't matter how many times it appears. I hope the fact there are more than one cell with the same answer doesn't mean excel can't perform what I need it to.

I appreciate any help with this. Thanks.

A</SPAN>B</SPAN>C</SPAN>D</SPAN>E </SPAN>F</SPAN>G</SPAN>H</SPAN>
1</SPAN>1</SPAN>2</SPAN>3</SPAN>4</SPAN>
2</SPAN>Top</SPAN>£37,930</SPAN>£39,830</SPAN>£41,830</SPAN>£44,130</SPAN>Group</SPAN>Bottom</SPAN>
3</SPAN>Top</SPAN>£37,930</SPAN>£39,830</SPAN>£41,830</SPAN>£44,130</SPAN>Stage</SPAN>2</SPAN>
4</SPAN>Top</SPAN>£37,245</SPAN>£39,145</SPAN>£41,045</SPAN>£43,345</SPAN>Current Amount</SPAN>£30,941</SPAN>
5</SPAN>Top</SPAN>£36,459</SPAN>£38,359</SPAN>£40,259</SPAN>£42,559</SPAN>Proposed Amount</SPAN>?
6</SPAN>Top</SPAN>£35,774</SPAN>£37,574</SPAN>£39,374</SPAN>£41,674</SPAN>
7</SPAN>Top</SPAN>£34,988</SPAN>£36,688</SPAN>£38,488</SPAN>£40,688</SPAN>
8</SPAN>Top</SPAN>£34,988</SPAN>£36,688</SPAN>£38,488</SPAN>£40,688</SPAN>
9</SPAN>Bottom</SPAN>£33,334</SPAN>£34,834</SPAN>£36,534</SPAN>£38,634</SPAN>
10</SPAN>Bottom</SPAN>£33,334</SPAN>£34,834</SPAN>£36,534</SPAN>£38,634</SPAN>
11</SPAN>Bottom</SPAN>£32,758</SPAN>£34,158</SPAN>£35,758</SPAN>£37,858</SPAN>
12</SPAN>Bottom</SPAN>£32,182</SPAN>£33,582</SPAN>£35,082</SPAN>£37,182</SPAN>
13</SPAN>Bottom</SPAN>£31,507</SPAN>£32,807</SPAN>£34,007</SPAN>£35,907</SPAN>
14</SPAN>Bottom</SPAN>£30,931</SPAN>£32,031</SPAN>£33,131</SPAN>£34,731</SPAN>
15</SPAN>Bottom</SPAN>£30,931</SPAN>£32,031</SPAN>£33,131</SPAN>£34,731</SPAN>

<TBODY>
</TBODY>
 
Upvote 0
Hello everyone,

How do I use VLookUp and Match (or any other excel formula) to return the nearest value from a range of values? The answer will be in cell H5. I need excel to use cells H2 and H3 as the search criteria to find the closest value equal to or above the value in cell H4. The table is cells A1:E15. I know there is sometimes more than one equal answer but I need to know the value it doesn't matter how many times it appears. I hope the fact there are more than one cell with the same answer doesn't mean excel can't perform what I need it to.

I appreciate any help with this. Thanks.

A</SPAN>
B</SPAN>
C</SPAN>
D</SPAN>
E </SPAN>
F</SPAN>
G</SPAN>
H</SPAN>
1</SPAN>
1</SPAN>
2</SPAN>
3</SPAN>
4</SPAN>
2</SPAN>
Top</SPAN>
£37,930</SPAN>
£39,830</SPAN>
£41,830</SPAN>
£44,130</SPAN>
Group</SPAN>
Bottom</SPAN>
3</SPAN>
Top</SPAN>
£37,930</SPAN>
£39,830</SPAN>
£41,830</SPAN>
£44,130</SPAN>
Stage</SPAN>
2</SPAN>
4</SPAN>
Top</SPAN>
£37,245</SPAN>
£39,145</SPAN>
£41,045</SPAN>
£43,345</SPAN>
Current Amount</SPAN>
£30,941</SPAN>
5</SPAN>
Top</SPAN>
£36,459</SPAN>
£38,359</SPAN>
£40,259</SPAN>
£42,559</SPAN>
Proposed Amount</SPAN>
?
6</SPAN>
Top</SPAN>
£35,774</SPAN>
£37,574</SPAN>
£39,374</SPAN>
£41,674</SPAN>
7</SPAN>
Top</SPAN>
£34,988</SPAN>
£36,688</SPAN>
£38,488</SPAN>
£40,688</SPAN>
8</SPAN>
Top</SPAN>
£34,988</SPAN>
£36,688</SPAN>
£38,488</SPAN>
£40,688</SPAN>
9</SPAN>
Bottom</SPAN>
£33,334</SPAN>
£34,834</SPAN>
£36,534</SPAN>
£38,634</SPAN>
10</SPAN>
Bottom</SPAN>
£33,334</SPAN>
£34,834</SPAN>
£36,534</SPAN>
£38,634</SPAN>
11</SPAN>
Bottom</SPAN>
£32,758</SPAN>
£34,158</SPAN>
£35,758</SPAN>
£37,858</SPAN>
12</SPAN>
Bottom</SPAN>
£32,182</SPAN>
£33,582</SPAN>
£35,082</SPAN>
£37,182</SPAN>
13</SPAN>
Bottom</SPAN>
£31,507</SPAN>
£32,807</SPAN>
£34,007</SPAN>
£35,907</SPAN>
14</SPAN>
Bottom</SPAN>
£30,931</SPAN>
£32,031</SPAN>
£33,131</SPAN>
£34,731</SPAN>
15</SPAN>
Bottom</SPAN>
£30,931</SPAN>
£32,031</SPAN>
£33,131</SPAN>
£34,731</SPAN>

<TBODY>
</TBODY>

I suppose the desire value is: 32,031

H4, control+shift+enter, not just enter:
Rich (BB code):
=MIN(IF($A$2:$A$15=H2,IF(INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0))>=H4,
  INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0)))))
 
Upvote 0
Thank you for the quick replies above. I have another question that I need help with. In the sheet below I need the answer in H4 and I need excel to look at the stage (H2) and the proposed amount (H3), match this in the cells B3:E16 and find the central value in that row from column A.

I apologise for the format alignment. Thank you.

Vivienne
A</SPAN>
B</SPAN>
C</SPAN>
D</SPAN>
E</SPAN>
F</SPAN>
G</SPAN>
H</SPAN>
1</SPAN>
Proposed Amount</SPAN>
2</SPAN>
Central</SPAN>
1</SPAN>
2</SPAN>
3</SPAN>
4</SPAN>
Stage</SPAN>
2</SPAN>
3</SPAN>
£33,830</SPAN>
£37,930</SPAN>
£39,830</SPAN>
£41,830</SPAN>
£44,130</SPAN>
Proposed Amount</SPAN>
£32,031</SPAN>
4</SPAN>
£33,830</SPAN>
£37,930</SPAN>
£39,830</SPAN>
£41,830</SPAN>
£44,130</SPAN>
Central</SPAN>
5</SPAN>
£33,145</SPAN>
£37,245</SPAN>
£39,145</SPAN>
£41,045</SPAN>
£43,345</SPAN>
6</SPAN>
£32,459</SPAN>
£36,459</SPAN>
£38,359</SPAN>
£40,259</SPAN>
£42,559</SPAN>
7</SPAN>
£31,774</SPAN>
£35,774</SPAN>
£37,574</SPAN>
£39,374</SPAN>
£41,674</SPAN>
8</SPAN>
£31,088</SPAN>
£34,988</SPAN>
£36,688</SPAN>
£38,488</SPAN>
£40,688</SPAN>
9</SPAN>
£31,088</SPAN>
£34,988</SPAN>
£36,688</SPAN>
£38,488</SPAN>
£40,688</SPAN>
10</SPAN>
£29,534</SPAN>
£33,334</SPAN>
£34,834</SPAN>
£36,534</SPAN>
£38,634</SPAN>
11</SPAN>
£29,534</SPAN>
£33,334</SPAN>
£34,834</SPAN>
£36,534</SPAN>
£38,634</SPAN>
12</SPAN>
£28,958</SPAN>
£32,758</SPAN>
£34,158</SPAN>
£35,758</SPAN>
£37,858</SPAN>
13</SPAN>
£28,382</SPAN>
£32,182</SPAN>
£33,582</SPAN>
£35,082</SPAN>
£37,182</SPAN>
14</SPAN>
£27,807</SPAN>
£31,507</SPAN>
£32,807</SPAN>
£34,007</SPAN>
£35,907</SPAN>
15</SPAN>
£27,231</SPAN>
£30,931</SPAN>
£32,031</SPAN>
£33,131</SPAN>
£34,731</SPAN>
16</SPAN>
£27,231</SPAN>
£30,931</SPAN>
£32,031</SPAN>
£33,131</SPAN>
£34,731</SPAN>

<TBODY>
</TBODY>

H4, just enter:

=INDEX($A$3:$A$16,MATCH(H3,INDEX($B$3:$E$16,0,MATCH(H2,$B$2:$E$2,0)),0))

which is not volatile.
 
Upvote 0
Thanks for the reply. I need the formula to try and pick the closest greater proposed value to the current value and the previous formula I had worked =MIN(IF(A2:A15=H2,IF(B1:E1=H3,IF(B2:E15>=H4,B2:E15)))). However I have now noticed that in my larger data table (the table displayed is just a snapshot) the current value could be higher than the largest value for the proposed value options. I therefore need the formula to do as the above formula but to also pick the highest proposed value for that particular group and stage if there is no higher option than the current value. The following formula returns a zero figure:<o:p></o:p>
<o:p> </o:p>
=MIN(IF($A$2:$A$15=H2,IF(INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0))>=H4,<o:p></o:p>
INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0)))))<o:p></o:p>
 
Upvote 0
Thanks for the reply. I need the formula to try and pick the closest greater proposed value to the current value and the previous formula I had worked =MIN(IF(A2:A15=H2,IF(B1:E1=H3,IF(B2:E15>=H4,B2:E15)))). However I have now noticed that in my larger data table (the table displayed is just a snapshot) the current value could be higher than the largest value for the proposed value options. I therefore need the formula to do as the above formula but to also pick the highest proposed value for that particular group and stage if there is no higher option than the current value. The following formula returns a zero figure:<o:p></o:p>
<o:p></o:p>
=MIN(IF($A$2:$A$15=H2,IF(INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0))>=H4,<o:p></o:p>
INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0)))))<o:p></o:p>

You probably did not apply control+shift+enter. Also, you do not seem to have noticed the reported result. Another point: Try to post the desired value that you want to see instead of just a question mark.

See the workbook that implement the proposed dormulas:
https://dl.dropboxusercontent.com/u/65698317/vivienne3608%20proposed%20amount%20%2B%20central.xlsx
 
Upvote 0
Thanks for the reply. I need the formula to try and pick the closest greater proposed value to the current value and the previous formula I had worked =MIN(IF(A2:A15=H2,IF(B1:E1=H3,IF(B2:E15>=H4,B2:E15)))). However I have now noticed that in my larger data table (the table displayed is just a snapshot) the current value could be higher than the largest value for the proposed value options. I therefore need the formula to do as the above formula but to also pick the highest proposed value for that particular group and stage if there is no higher option than the current value. The following formula returns a zero figure:</SPAN></SPAN>

=MIN(IF($A$2:$A$15=H2,IF(INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0))>=H4,</SPAN></SPAN>
INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0)))))</SPAN></SPAN>

The table below shows the higher current value and the proposed amount I need the formula to return. I know the proposed value I need appears twice, however, it doesn’t matter which cell the formula picks. The cells B2:E15 contain the proposed amounts.</SPAN></SPAN>


A</SPAN>
B</SPAN>
C</SPAN>
D</SPAN>
E</SPAN>
F</SPAN>
G</SPAN>
H</SPAN>
1</SPAN>

1</SPAN>
2</SPAN>
3</SPAN>
4</SPAN>



2</SPAN>
Top</SPAN>
37,930</SPAN>
39,830</SPAN>
41,830</SPAN>
44,130</SPAN>

Group</SPAN>
Bottom</SPAN>
3</SPAN>
Top</SPAN>
37,930</SPAN>
39,830</SPAN>
41,830</SPAN>
44,130</SPAN>

Stage</SPAN>
1</SPAN>
4</SPAN>
Top</SPAN>
37,245</SPAN>
39,145</SPAN>
41,045</SPAN>
43,345</SPAN>

Current Amount</SPAN>
34,719</SPAN>
5</SPAN>
Top</SPAN>
36,459</SPAN>
38,359</SPAN>
40,259</SPAN>
42,559</SPAN>

Proposed Amount</SPAN>
33,334</SPAN>
6</SPAN>
Top</SPAN>
35,774</SPAN>
37,574</SPAN>
39,374</SPAN>
41,674</SPAN>



7</SPAN>
Top</SPAN>
34,988</SPAN>
36,688</SPAN>
38,488</SPAN>
40,688</SPAN>



8</SPAN>
Top</SPAN>
34,988</SPAN>
36,688</SPAN>
38,488</SPAN>
40,688</SPAN>



9</SPAN>
Bottom</SPAN>
33,334</SPAN>
34,834</SPAN>
36,534</SPAN>
38,634</SPAN>



10</SPAN>
Bottom</SPAN>
33,334</SPAN>
34,834</SPAN>
36,534</SPAN>
38,634</SPAN>



11</SPAN>
Bottom</SPAN>
32,758</SPAN>
34,158</SPAN>
35,758</SPAN>
37,858</SPAN>



12</SPAN>
Bottom</SPAN>
32,182</SPAN>
33,582</SPAN>
35,082</SPAN>
37,182</SPAN>



13</SPAN>
Bottom</SPAN>
31,507</SPAN>
32,807</SPAN>
34,007</SPAN>
35,907</SPAN>



14</SPAN>
Bottom</SPAN>
30,931</SPAN>
32,031</SPAN>
33,131</SPAN>
34,731</SPAN>



15</SPAN>
Bottom</SPAN>
30,931</SPAN>
32,031</SPAN>
33,131</SPAN>
34,731</SPAN>




<TBODY>
</TBODY>
 
Upvote 0
Thanks for the reply. I need the formula to try and pick the closest greater proposed value to the current value and the previous formula I had worked =MIN(IF(A2:A15=H2,IF(B1:E1=H3,IF(B2:E15>=H4,B2:E15)))). However I have now noticed that in my larger data table (the table displayed is just a snapshot) the current value could be higher than the largest value for the proposed value options. I therefore need the formula to do as the above formula but to also pick the highest proposed value for that particular group and stage if there is no higher option than the current value. The following formula returns a zero figure:</SPAN></SPAN>

=MIN(IF($A$2:$A$15=H2,IF(INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0))>=H4,</SPAN></SPAN>
INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0)))))</SPAN></SPAN>

The table below shows the higher current value and the proposed amount I need the formula to return. I know the proposed value I need appears twice, however, it doesn’t matter which cell the formula picks. The cells B2:E15 contain the proposed amounts.</SPAN></SPAN>

A</SPAN>
B</SPAN>
C</SPAN>
D</SPAN>
E</SPAN>
F</SPAN>
G</SPAN>
H</SPAN>
1</SPAN>
1</SPAN>
2</SPAN>
3</SPAN>
4</SPAN>
2</SPAN>
Top</SPAN>
37,930</SPAN>
39,830</SPAN>
41,830</SPAN>
44,130</SPAN>
Group</SPAN>
Bottom</SPAN>
3</SPAN>
Top</SPAN>
37,930</SPAN>
39,830</SPAN>
41,830</SPAN>
44,130</SPAN>
Stage</SPAN>
1</SPAN>
4</SPAN>
Top</SPAN>
37,245</SPAN>
39,145</SPAN>
41,045</SPAN>
43,345</SPAN>
Current Amount</SPAN>
34,719</SPAN>
5</SPAN>
Top</SPAN>
36,459</SPAN>
38,359</SPAN>
40,259</SPAN>
42,559</SPAN>
Proposed Amount</SPAN>
33,334</SPAN>
6</SPAN>
Top</SPAN>
35,774</SPAN>
37,574</SPAN>
39,374</SPAN>
41,674</SPAN>
7</SPAN>
Top</SPAN>
34,988</SPAN>
36,688</SPAN>
38,488</SPAN>
40,688</SPAN>
8</SPAN>
Top</SPAN>
34,988</SPAN>
36,688</SPAN>
38,488</SPAN>
40,688</SPAN>
9</SPAN>
Bottom</SPAN>
33,334</SPAN>
34,834</SPAN>
36,534</SPAN>
38,634</SPAN>
10</SPAN>
Bottom</SPAN>
33,334</SPAN>
34,834</SPAN>
36,534</SPAN>
38,634</SPAN>
11</SPAN>
Bottom</SPAN>
32,758</SPAN>
34,158</SPAN>
35,758</SPAN>
37,858</SPAN>
12</SPAN>
Bottom</SPAN>
32,182</SPAN>
33,582</SPAN>
35,082</SPAN>
37,182</SPAN>
13</SPAN>
Bottom</SPAN>
31,507</SPAN>
32,807</SPAN>
34,007</SPAN>
35,907</SPAN>
14</SPAN>
Bottom</SPAN>
30,931</SPAN>
32,031</SPAN>
33,131</SPAN>
34,731</SPAN>
15</SPAN>
Bottom</SPAN>
30,931</SPAN>
32,031</SPAN>
33,131</SPAN>
34,731</SPAN>

<TBODY>
</TBODY>

What would be the result (the proposed amount) if we had 32,182 as Current Amount?
 
Upvote 0
What would be the result (the proposed amount) if we had 32,182 as Current Amount?

Nevermind. I guess you mean:

H5, control+shift+enter, not just enter:
Rich (BB code):
=IFERROR(1/(1/MIN(IF($A$2:$A$15=H2,
  IF(INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0))>=H4,
  INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0)))))),
  MAX(IF($A$2:$A$15=H2,INDEX($B$2:$E$15,0,MATCH(H3,$B$1:$E$1,0)))))
 
Upvote 0

Forum statistics

Threads
1,215,815
Messages
6,127,035
Members
449,355
Latest member
g wiggle

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