Getting a Match Function to Lookup a Numeric Value Within a Range of Table Headers

Golden Age

New Member
Joined
Nov 1, 2006
Messages
26
Hello, everyone. Since my last thread that Andrew Fergus solved for me, I've been plugging successfully away still on the exact same project. I have hit another snag. The Screenshot below, shows only a single Column of a Table called CharacterClassSkills. Yes it is a full-fledged Table, complete with the dropdown arrows in Row 1, (though they don't show up in my Screenshot). Each cell under this Table Header, "IQ", has a formula that uses Index and Match to lookup a value.

BZR
1IQ
2#N/A
3#N/A

<tbody>
</tbody>
Data

Worksheet Formulas
CellFormula
BZR2=INDEX(TableAttributeBonusSaves[#All],MATCH(CharacterClassSkills[[#Headers],[IQ]],TableAttributeBonusSaves[[#All],[Attribute]],0),MATCH(CharacterClassSkills[[#Headers],[Category]],SkillList[#Headers],0),MATCH(Stats!$I$6,TableAttributeBonusSaves[#Headers],0))

<tbody>
</tbody>

<tbody>
</tbody>


This is a section of the Table called TableAttributesBonusSaves, (a full-fledged table again), that I am trying to retrieve the sought-after value from. I want the Index/Match Function to find the value, 1, in Cell BFU2.

BFFBFGBFHBFIBFJBFKBFLBFMBFNBFOBFPBFQBFRBFSBFTBFU
1AttributeCategory1234567891011121314
2IQ1
3ME
4ME

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Data





This is the the Screenshot showing one of the Match criteria on the Worksheet Stats!.

GHI
5
6IQ14
7

<tbody>
</tbody>
Stats




The formula I can't make work is:

=INDEX(TableAttributeBonusSaves[#All],MATCH(CharacterClassSkills[[#Headers],[IQ]],TableAttributeBonusSaves[[#All],[Attribute]],0),MATCH(Stats!$I$6,TableAttributeBonusSaves[#Headers],0))

It returns the error message "A value is not available to the formula or function". Now I first thought, that there was an issue of the Table Headers being Text and therefore I couldn't use the Match function seeking the number 14 to lookup the desired Column Header because the Headers were Text. So, I left cells BFF1:BFF2 as "General" format, but changed all the cells from BFH1 onward to "Number" format. It didn't change the outcome of the Index Match Function lookup. I still got the same error message.

I then isolated which part of my overall function is producing the error. This Match portion: MATCH(CharacterClassSkills[[#Headers],[IQ]],TableAttributeBonusSaves[[#All],[Attribute]],0) did give me the correct Row for my Index lookup. Fantastic! The error crops up because of this Match portion: MATCH(Stats!$I$6,TableAttributeBonusSaves[#Headers],0). I suspect that it's because of Table Header cell formatting, but I'm at a loss of what else to try other than what I did try already. Does anyone have any ideas to help me out? Thank you in advance. :)
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Not sure i understand what you need - see if this works
=INDEX(TableAttributeBonusSaves[#All],MATCH(CharacterClassSkills[[#Headers],[IQ]],TableAttributeBonusSaves[[#All],[Attribute]],0),MATCH(Stats!$I$6&"",TableAttributeBonusSaves[#Headers],0))

M.
 
Upvote 0
The value that you put in the header, when you convert it into a table, excel simply identifies it as text, that's why you should treat it as text.
You must convert the number 14 that you have in cell I6 to text or also the way Marcelo used it.


=INDEX(TableAttributeBonusSaves[#All],MATCH(CharacterClassSkills[[#Headers],[IQ]],TableAttributeBonusSaves[[#All],[Attribute]],0),MATCH(Text(Stats!$I$6, "#"),TableAttributeBonusSaves[#Headers],0))
 
Upvote 0
My very great thanks to both of you. I tried out both your formulas and they do exactly what I wanted. I was worried that somehow that number 1, I was trying to lookup, would be converted to "text", and consequently couldn't be used as a number in the subsequent SUM formula, but my concerns were unnecessary. I haven't the foggiest idea how the TEXT and "#" features of DanteAmor, and the &"" feature of Marcelo work but I'm going to Google search those to find out. Thank you again. I really appreciate it. (y)
 
Upvote 0
My very great thanks to both of you. I tried out both your formulas and they do exactly what I wanted. I was worried that somehow that number 1, I was trying to lookup, would be converted to "text", and consequently couldn't be used as a number in the subsequent SUM formula, but my concerns were unnecessary. I haven't the foggiest idea how the TEXT and "#" features of DanteAmor, and the &"" feature of Marcelo work but I'm going to Google search those to find out. Thank you again. I really appreciate it. (y)


The two options simply convert a numeric value to a text value. In this case the number 14 is still 14 but as a string.

I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,621
Messages
6,120,568
Members
448,972
Latest member
Shantanu2024

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