SOLVED: Index/Match, indirect... if my cell contains text, formula works; if it contains a number I get a #N/A - how to fix?

minddumps

New Member
Joined
Jun 29, 2011
Messages
16
Hello all,

I am working with a somewhat complicated formula that seems to work when referencing cell values with text, but not when cell values are numbers:

Code:
=INDEX(INDIRECT("'"&C$6&$D$2&"'!"&"$B$5:$I$15"),MATCH($B18,INDIRECT("'"&C$6&$D$2&"'!"&"$A$5:$A$15"),0),MATCH([B][COLOR=#ff0000]$B$17[/COLOR][/B],INDIRECT("'"&C$6&$D$2&"'!"&"B4:I4"),0))

I'm unable to use the function button to work the formula piece by piece because the data is volatile but I found out that as stated above, when $B$17 is a * or contains text, I am given the correct cell results. When I change $B$17 to a "1" for example, I'm given #N/A instead of the correct results.

I'm using Excel 2013 on Windows 10. Do you know the solution to getting this formula to work properly with numbers?

I figured it out. For those searching, we have to tell excel that even if it finds a cell reference as a number, we want it to see it as text. Here's the fixed code:
Code:
=INDEX(INDIRECT("'"&C$6&$D$2&"'!"&"$B$5:$I$15"),MATCH($B18,INDIRECT("'"&C$6&$D$2&"'!"&"$A$5:$A$15"),0),MATCH(TEXT($B$17,"0"),INDIRECT("'"&C$6&$D$2&"'!"&"B4:I4"),0))
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,224,822
Messages
6,181,165
Members
453,021
Latest member
Justyna P

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