How to assign a name to a specific cell in a table?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,535
Office Version
  1. 365
Platform
  1. Windows
Is there a way to assign name to a specific cell in a table that will stay wsith that cell if the table is resorted?

I founbd some instructions on the web that said to select the cell and enter the name in the Name Box. But if I resort the table, the name does not follow the cell, it stays at the same relative physcial position in the table.

Thanks
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Is there a way to assign name to a specific cell in a table that will stay wsith that cell if the table is resorted?

I founbd some instructions on the web that said to select the cell and enter the name in the Name Box. But if I resort the table, the name does not follow the cell, it stays at the same relative physcial position in the table.

Thanks
It sounds like you're talking about a Named Range. If so, YES, a single cell could serve as a Named Range and will not move if you use an absolute reference.

Here I created two tests:

Column A is a standard range where I Named $A$7 as lstNamedCell and holds value #667.
Column C is a Table where I Named $C$7 as tblNamedCell and holds value #667 as well.

1675504551922.png

Here I sorted each column in ascending order. Although the values #667 moved from Row 6 to Row 7, the Named Cells are still $A$7 and $C$7 respectively and now hold value #650.

1675504719528.png
 
Upvote 0
I think I wasn't clear. Let me try again.

Here is a table with some names, dates of birth, and ages. It is sorted by name. On the right, I added 3 ways to access Rosa's date of birth. They all get the correct answer as the table is currently sorted.

Family Database.xlsx
CDEFGH
5NameDoBAgeNameDoB
6Amelia7/02/1937 85.6Rosa12/01/1955
7Dwight6/06/1944 78.7Rosa12/01/1955
8Franklin12/07/1941 81.2Rosa12/01/1955
9Gloria12/15/1971 51.1
10John10/16/1962 60.3
11Robert8/06/1945 77.5
12Rosa12/01/1955 67.2
MrExcel
Cell Formulas
RangeFormula
H6H6=$D$12
H7H7=D12
H8H8=XLOOKUP(G8,TblTest[Name],TblTest[DoB])
E6:E12E6=CONVERT(TODAY()-[@DoB],"day","yr")


Now I resort the table by date of birth (or age). The first 2 now have the wrong answer. Only the third one tracks correctly. So that's the solution I was looking for.

Family Database.xlsx
CDEFGH
5NameDoBAgeNameDoB
6Gloria12/15/1971 51.1Rosa7/02/1937
7John10/16/1962 60.3Rosa7/02/1937
8Rosa12/01/1955 67.2Rosa12/01/1955
9Robert8/06/1945 77.5
10Dwight6/06/1944 78.7
11Franklin12/07/1941 81.2
12Amelia7/02/1937 85.6
MrExcel
Cell Formulas
RangeFormula
H6H6=$D$12
H7H7=D12
H8H8=XLOOKUP(G8,TblTest[Name],TblTest[DoB])
E6:E12E6=CONVERT(TODAY()-[@DoB],"day","yr")


I guess I was hoping for something like =TblTest[DoB[Name="Rosa"]].

Comments?
 
Upvote 0

Forum statistics

Threads
1,215,250
Messages
6,123,887
Members
449,130
Latest member
lolasmith

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