Naming cells in a table based on column and row label

L

Lee.Kinkade

I have a table, and I want to name the cells base on information in the
column and the row. For example, the in the table below, I would like
the second cell in the second row to be named MilkCarb because of the
contents of the left column and the top row. Is there a way to
automatically name all the cells in a table like this?

Food Carb Protein Fat Kcal
Milk 12 8 0 90
Veg 5 2 0 25
Fruit 15 0 0 60
 
R

RichardSchollar

Tools>Options>Calculation tab and check "Accept labels in formulas"

Then, in the given example you can use a construct like

=Milk Carb

to return 12

=Fruit Fat

to return 0

Note the space between values.

I can't seem to get this to work on sheets other than the one on which
the table resides though.

Best regards

Richard
 
G

Gord Dibben

Richard

To get the names to work in other sheets you can select the range and
Insert>Names>Create.

Checkmark in "Top Row" and "Left Column"

Now try =Milk Carb on another sheet.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top