#VALUE! Error on Index Function

bigmyk2k

Board Regular
Joined
Feb 9, 2012
Messages
104
I am using an Index/Match Function on a named range lookup, and I am getting a Value error, but in the Function Arguments tool, it returns everything correctly, other than the result.

My Function is: =INDEX(VLOOKUP($D$2,Section,2,FALSE),MATCH(B10,Duration,0),5)

The Array VLookup correctly returns Sec_5
The Row_num Match correctly returns 5
The Column_num shows as 5 (4-MO)
Thus, I would expect the result to be: 1.67

But, I get the #VALUE! error.

In range (named Sec_5) I have the following values:
[TABLE="width: 806"]
<colgroup><col><col><col><col><col><col><col><col span="7"></colgroup><tbody>[TR]
[TD]Section[/TD]
[TD]Duration[/TD]
[TD]2-MO[/TD]
[TD]3-MO[/TD]
[TD]4-MO[/TD]
[TD]6-MO[/TD]
[TD]9-MO[/TD]
[TD]1-YR[/TD]
[TD]2-YR[/TD]
[TD]5-YR[/TD]
[TD]10-YR[/TD]
[TD]25-YR[/TD]
[TD]50-YR[/TD]
[TD]100-YR[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]10-DAY[/TD]
[TD="align: center"]2.2[/TD]
[TD="align: center"]2.64[/TD]
[TD="align: center"]3.05[/TD]
[TD="align: center"]3.58[/TD]
[TD="align: center"]4.12[/TD]
[TD="align: center"]4.48[/TD]
[TD="align: center"]5.2[/TD]
[TD="align: center"]6.22[/TD]
[TD="align: center"]7.22[/TD]
[TD="align: center"]8.61[/TD]
[TD="align: center"]9.66[/TD]
[TD="align: center"]10.88[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]5-DAY[/TD]
[TD="align: center"]1.76[/TD]
[TD="align: center"]2.11[/TD]
[TD="align: center"]2.39[/TD]
[TD="align: center"]2.77[/TD]
[TD="align: center"]3.18[/TD]
[TD="align: center"]3.46[/TD]
[TD="align: center"]4.05[/TD]
[TD="align: center"]4.94[/TD]
[TD="align: center"]5.72[/TD]
[TD="align: center"]6.92[/TD]
[TD="align: center"]7.98[/TD]
[TD="align: center"]9.18[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]72-HR[/TD]
[TD="align: center"]1.51[/TD]
[TD="align: center"]1.77[/TD]
[TD="align: center"]2[/TD]
[TD="align: center"]2.32[/TD]
[TD="align: center"]2.67[/TD]
[TD="align: center"]2.9[/TD]
[TD="align: center"]3.47[/TD]
[TD="align: center"]4.41[/TD]
[TD="align: center"]5.16[/TD]
[TD="align: center"]6.22[/TD]
[TD="align: center"]7.06[/TD]
[TD="align: center"]8.12[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]48-HR[/TD]
[TD="align: center"]1.4[/TD]
[TD="align: center"]1.64[/TD]
[TD="align: center"]1.82[/TD]
[TD="align: center"]2.11[/TD]
[TD="align: center"]2.43[/TD]
[TD="align: center"]2.64[/TD]
[TD="align: center"]3.13[/TD]
[TD="align: center"]3.93[/TD]
[TD="align: center"]4.67[/TD]
[TD="align: center"]5.75[/TD]
[TD="align: center"]6.52[/TD]
[TD="align: center"]7.33[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]24-HR[/TD]
[TD="align: center"]1.31[/TD]
[TD="align: center"]1.52[/TD]
[TD="align: center"]1.67[/TD]
[TD="align: center"]1.93[/TD]
[TD="align: center"]2.19[/TD]
[TD="align: center"]2.38[/TD]
[TD="align: center"]2.91[/TD]
[TD="align: center"]3.64[/TD]
[TD="align: center"]4.27[/TD]
[TD="align: center"]5.15[/TD]
[TD="align: center"]5.87[/TD]
[TD="align: center"]6.61[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]18-HR[/TD]
[TD="align: center"]1.23[/TD]
[TD="align: center"]1.43[/TD]
[TD="align: center"]1.57[/TD]
[TD="align: center"]1.81[/TD]
[TD="align: center"]2.06[/TD]
[TD="align: center"]2.24[/TD]
[TD="align: center"]2.74[/TD]
[TD="align: center"]3.42[/TD]
[TD="align: center"]4.01[/TD]
[TD="align: center"]4.84[/TD]
[TD="align: center"]5.52[/TD]
[TD="align: center"]6.21[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]12-HR[/TD]
[TD="align: center"]1.14[/TD]
[TD="align: center"]1.32[/TD]
[TD="align: center"]1.45[/TD]
[TD="align: center"]1.68[/TD]
[TD="align: center"]1.9[/TD]
[TD="align: center"]2.07[/TD]
[TD="align: center"]2.53[/TD]
[TD="align: center"]3.17[/TD]
[TD="align: center"]3.71[/TD]
[TD="align: center"]4.48[/TD]
[TD="align: center"]5.11[/TD]
[TD="align: center"]5.75[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]6-HR[/TD]
[TD="align: center"]0.98[/TD]
[TD="align: center"]1.15[/TD]
[TD="align: center"]1.25[/TD]
[TD="align: center"]1.45[/TD]
[TD="align: center"]1.65[/TD]
[TD="align: center"]1.79[/TD]
[TD="align: center"]2.18[/TD]
[TD="align: center"]2.73[/TD]
[TD="align: center"]3.2[/TD]
[TD="align: center"]3.86[/TD]
[TD="align: center"]4.4[/TD]
[TD="align: center"]4.96[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]3-HR[/TD]
[TD="align: center"]0.84[/TD]
[TD="align: center"]0.97[/TD]
[TD="align: center"]1.06[/TD]
[TD="align: center"]1.23[/TD]
[TD="align: center"]1.4[/TD]
[TD="align: center"]1.52[/TD]
[TD="align: center"]1.86[/TD]
[TD="align: center"]2.33[/TD]
[TD="align: center"]2.73[/TD]
[TD="align: center"]3.3[/TD]
[TD="align: center"]3.76[/TD]
[TD="align: center"]4.23[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]2-HR[/TD]
[TD="align: center"]0.76[/TD]
[TD="align: center"]0.88[/TD]
[TD="align: center"]0.97[/TD]
[TD="align: center"]1.12[/TD]
[TD="align: center"]1.27[/TD]
[TD="align: center"]1.38[/TD]
[TD="align: center"]1.69[/TD]
[TD="align: center"]2.11[/TD]
[TD="align: center"]2.48[/TD]
[TD="align: center"]2.99[/TD]
[TD="align: center"]3.4[/TD]
[TD="align: center"]3.83[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]1-HR[/TD]
[TD="align: center"]0.62[/TD]
[TD="align: center"]0.72[/TD]
[TD="align: center"]0.78[/TD]
[TD="align: center"]0.91[/TD]
[TD="align: center"]1.03[/TD]
[TD="align: center"]1.12[/TD]
[TD="align: center"]1.37[/TD]
[TD="align: center"]1.71[/TD]
[TD="align: center"]2.01[/TD]
[TD="align: center"]2.42[/TD]
[TD="align: center"]2.76[/TD]
[TD="align: center"]3.11[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]30-MIN[/TD]
[TD="align: center"]0.48[/TD]
[TD="align: center"]0.56[/TD]
[TD="align: center"]0.62[/TD]
[TD="align: center"]0.71[/TD]
[TD="align: center"]0.81[/TD]
[TD="align: center"]0.88[/TD]
[TD="align: center"]1.08[/TD]
[TD="align: center"]1.35[/TD]
[TD="align: center"]1.58[/TD]
[TD="align: center"]1.91[/TD]
[TD="align: center"]2.17[/TD]
[TD="align: center"]2.45[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]15-MIN[/TD]
[TD="align: center"]0.35[/TD]
[TD="align: center"]0.41[/TD]
[TD="align: center"]0.45[/TD]
[TD="align: center"]0.52[/TD]
[TD="align: center"]0.59[/TD]
[TD="align: center"]0.64[/TD]
[TD="align: center"]0.79[/TD]
[TD="align: center"]0.98[/TD]
[TD="align: center"]1.15[/TD]
[TD="align: center"]1.39[/TD]
[TD="align: center"]1.58[/TD]
[TD="align: center"]1.78[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]10-MIN[/TD]
[TD="align: center"]0.28[/TD]
[TD="align: center"]0.32[/TD]
[TD="align: center"]0.35[/TD]
[TD="align: center"]0.41[/TD]
[TD="align: center"]0.46[/TD]
[TD="align: center"]0.5[/TD]
[TD="align: center"]0.61[/TD]
[TD="align: center"]0.76[/TD]
[TD="align: center"]0.9[/TD]
[TD="align: center"]1.08[/TD]
[TD="align: center"]1.23[/TD]
[TD="align: center"]1.39[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]5-MIN[/TD]
[TD="align: center"]0.16[/TD]
[TD="align: center"]0.19[/TD]
[TD="align: center"]0.2[/TD]
[TD="align: center"]0.23[/TD]
[TD="align: center"]0.27[/TD]
[TD="align: center"]0.29[/TD]
[TD="align: center"]0.35[/TD]
[TD="align: center"]0.44[/TD]
[TD="align: center"]0.51[/TD]
[TD="align: center"]0.62[/TD]
[TD="align: center"]0.7[/TD]
[TD="align: center"]0.79[/TD]
[/TR]
</tbody>[/TABLE]
 
A bit late, but...if there aren't too many named section ranges...

Using this list in I1:J6
Code:
Ref      SecRef
Alpha     Sec_1
Bravo     Sec_2
Charlie   Sec_3
Delta     Sec_4
Echo      Sec_5

Note: the SecRef is just for illustration purposes. The real driver is the Ref column, which, when matched in the CHOOSE function, selects the correct section.

This regular, non-volatile formula seems to work:
Code:
=INDEX(CHOOSE(MATCH($D$2,$I$2:$I$6,0),Sec_1,Sec_2,Sec_3,Sec_4,Sec_5),MATCH(B10,Duration,0),5)

Is that something you can work with?
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Sorry, that's not what I meant.
No worries, I think I misunderstood.

That's actually even simpler..
No need for the INDIRECT(VLOOKUP

Try
=LOOKUP(1.72,OFFSET(INDEX(Duration,MATCH(B10,Duration,0)),0,1,1,12))

That doesn't seem to be working, as the value "1.72" is not present in the row referenced.

To be a little more clear, I am looking to add a match to the original function, in order to also look up the Column Reference based on another value... maybe I should start another thread, since I am deviating from the original question?

Anyway, I am looking to fill out the following function:

=INDEX(INDIRECT(VLOOKUP($D$2,Section,2,FALSE)),MATCH($B$10,Duration,0),MATCH($B$9,)

OR (Evaluated to the point I'm asking about):

=INDEX(INDIRECT(Sec_5),5,MATCH($B$9,...)

Where- B9 = 1.72
 
Upvote 0
Works for me, formua in D10
B10 = 24-HR
C10 = 1.72

Excel Workbook
BCDEFGHIJKLMNOPQRS
1SectionDuration2-MO3-MO4-MO6-MO9-MO1-YR2-YR5-YR10-YR25-YR50-YR100-YR
2510-DAY2.22.643.053.584.124.485.26.227.228.619.6610.88
355-DAY1.762.112.392.773.183.464.054.945.726.927.989.18
4572-HR1.511.7722.322.672.93.474.415.166.227.068.12
5548-HR1.41.641.822.112.432.643.133.934.675.756.527.33
6524-HR1.311.521.671.932.192.382.913.644.275.155.876.61
7518-HR1.231.431.571.812.062.242.743.424.014.845.526.21
8512-HR1.141.321.451.681.92.072.533.173.714.485.115.75
956-HR0.981.151.251.451.651.792.182.733.23.864.44.96
1024-HR1.721.6753-HR0.840.971.061.231.41.521.862.332.733.33.764.23
1152-HR0.760.880.971.121.271.381.692.112.482.993.43.83
1251-HR0.620.720.780.911.031.121.371.712.012.422.763.11
13530-MIN0.480.560.620.710.810.881.081.351.581.912.172.45
14515-MIN0.350.410.450.520.590.640.790.981.151.391.581.78
15510-MIN0.280.320.350.410.460.50.610.760.91.081.231.39
1655-MIN0.160.190.20.230.270.290.350.440.510.620.70.79
Sheet1
#VALUE!
</td></tr></table></td></tr></table>
 
Upvote 0
That's close, but I think the confusion may be the named ranges.

The data you are calling "Duration" I am calling "Sec_5", and looking up with the indirect VLookup because there are 9 sections in my current data.

What my sheet refers to with the named range "Duration" is simply the drop-down list:
[TABLE="width: 54"]
<tbody>[TR]
[TD]Duration[/TD]
[/TR]
[TR]
[TD]10-DAY[/TD]
[/TR]
[TR]
[TD]5-DAY[/TD]
[/TR]
[TR]
[TD]72-HR[/TD]
[/TR]
[TR]
[TD]48-HR[/TD]
[/TR]
[TR]
[TD]24-HR[/TD]
[/TR]
[TR]
[TD]18-HR[/TD]
[/TR]
[TR]
[TD]12-HR[/TD]
[/TR]
[TR]
[TD]6-HR[/TD]
[/TR]
[TR]
[TD]3-HR[/TD]
[/TR]
[TR]
[TD]2-HR[/TD]
[/TR]
[TR]
[TD]1-HR[/TD]
[/TR]
[TR]
[TD]30-MIN[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
The data you are calling "Duration" I am calling "Sec_5", and looking up with the indirect VLookup because there are 9 sections in my current data.
No, your original formula used the range named 'Duration' to find the row #.

My Function is: =INDEX(VLOOKUP($D$2,Section,2,FALSE),MATCH(B10,Duration,0),5)

Then the relevant numbers were directly to the right of the column named Duration...

is that not how it's set up?
 
Upvote 0
I think I get it now..

You have several Sections, all of the same dimensions.
But the Duration range you used to find the row# was not the one in Sec_5
You just used any one of them, because they're all the same...


Try this

=LOOKUP(C10,OFFSET(INDEX(INDIRECT(VLOOKUP($D$2,Section,2,FALSE)),MATCH(B10,Duration,0),3),,,1,12))

Again, C10 = 1.72, B10 = 24-HR
 
Last edited:
Upvote 0
I think I get it now..

You have several Sections, all of the same dimensions.
But the Duration range you used to find the row# was not the one in Sec_5
You just used any one of them, because they're all the same...


Try this

=LOOKUP(C10,OFFSET(INDEX(INDIRECT(VLOOKUP($D$2,Section,2,FALSE)),MATCH(B10,Duration,0),3),,,1,12))

Again, C10 = 1.72, B10 = 24-HR

Hey Jon, Thanks for your help. That still doesn't work, but I think it is because I am asking a simplified version of the bigger question.
We have answered the original question from this thread, so I'm going to start a new thread and try to be a little more clear.
 
Upvote 0
No problem.
Make sure to include a link to this thread in your new thread.
So that responders can see what has already been tried, so to avoid duplicating work.
 
Upvote 0

Forum statistics

Threads
1,224,862
Messages
6,181,465
Members
453,045
Latest member
Abraxas_X

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