Absolute values and locked cells

dmotz

New Member
Joined
Aug 5, 2024
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I am trying to drag a formula across many columns, while maintaining the first two cells. However, I am having a problem locking the first two cells because once I select the range, it automatically adds the brackets for a Table, and I don’t know how to add a locked $ to that ($C$2:$C$100 instead of Table2[Name]).

Ultimately, I’m trying to drag the bottom right corner of the cell across multiple columns and only change the 3rd item, the Return Array in a Lookup formula.



Example:

=XLOOKUP([@Name], Table2[Name], Table2[Address])

=XLOOKUP([@Name], Table2[Name], Table2[City])

=XLOOKUP([@Name], Table2[Name], Table2[State])

Etc.



Is there a way to do this? How do I lock a table range when the brackets are added?



Thank you!
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Ultimately, I’m trying to drag the bottom right corner of the cell across multiple columns and only change the 3rd item, the Return Array in a Lookup formula.

What happens when you attempt this step? Do you get the expected results?
 
Upvote 0
Welcome to the MrExcel board!

Assuming that your formula is in Table1, try this
Excel Formula:
=XLOOKUP(@Table1[[Name]:[Name]], Table2[[Name]:[Name]], Table2[Address])

However, it may be simpler to replace that first part with a normal 'locked column address'. For example if your first name in Table1 was in, say, M2 then
Excel Formula:
=XLOOKUP($M2, Table2[[Name]:[Name]], Table2[Address])
 
Upvote 0
What happens when you attempt this step? Do you get the expected results?
What happens when you attempt this step? Do you get the expected results?
Thank you for the response. When I drag from the bottom right corner, all the cells change to the cell that I'm dragging them to (because they aren't locked). Example: =XLOOKUP([@Name], Table2[Name], Table2[Address]) becomes =XLOOKUP([@Address], Table2[Address], Table2[Phone]) then =XLOOKUP([@Phone], Table2[Phone], Table2[City]) then =XLOOKUP([@City], Table2[City], Table2[State]) etc. Nothing is locked. I guess the question I have is how do you lock a cell from changing when you drag it when the range is listed in brackets instead of A2:A100 format?
 
Upvote 0
Welcome to the MrExcel board!

Assuming that your formula is in Table1, try this
Excel Formula:
=XLOOKUP(@Table1[[Name]:[Name]], Table2[[Name]:[Name]], Table2[Address])

However, it may be simpler to replace that first part with a normal 'locked column address'. For example if your first name in Table1 was in, say, M2 then
Excel Formula:
=XLOOKUP($M2, Table2[[Name]:[Name]], Table2[Address])
That didn't work for me but thank you for trying. Maybe the ultimate question I have is how do you lock a cell from changing when you drag it when the range is listed in brackets [@[Name]] instead of A2:A100 format?
 
Upvote 0
That didn't work for me
In what way did it not work? Also, does it mean you tried both suggestions or just one of them?
Perhaps you can post a small set of sample data with so we can test with your data/layout. Here is mine using both suggestions. In Tables 1 and 3 I entered the first formula in the top cell of 'Column1' and those formulas automatically filled down the tables. I then selected all the formulas in 'Column1' and dragged right.

dmotz.xlsm
BCDEFGHIJKLMN
1Table2 ->NameAddressCityStateabcTable1 ->NameColumn1Column2Column3Column4
2Name1Addr1City1State1abc1Name3Addr3City3State3abc3
3Name2Addr2City2State2abc2Name4Addr4City4State4abc4
4Name3Addr3City3State3abc3Name2Addr2City2State2abc2
5Name4Addr4City4State4abc4
6Name5Addr5City5State5abc5
7Name6Addr6City6State6abc6Table3 ->NameColumn1Column2Column3Column4
8Name7Addr7City7State7abc7Name3Addr3City3State3abc3
9Name4Addr4City4State4abc4
10Name2Addr2City2State2abc2
11
Sheet1
Cell Formulas
RangeFormula
K2:K4K2=XLOOKUP(@Table1[[Name]:[Name]], Table2[[Name]:[Name]], Table2[Address])
L2:L4L2=XLOOKUP(@Table1[[Name]:[Name]], Table2[[Name]:[Name]], Table2[City])
M2:M4M2=XLOOKUP(@Table1[[Name]:[Name]], Table2[[Name]:[Name]], Table2[State])
N2:N4N2=XLOOKUP(@Table1[[Name]:[Name]], Table2[[Name]:[Name]], Table2[abc])
K8:K10K8=XLOOKUP($J8, Table2[[Name]:[Name]], Table2[Address])
L8:L10L8=XLOOKUP($J8, Table2[[Name]:[Name]], Table2[City])
M8:M10M8=XLOOKUP($J8, Table2[[Name]:[Name]], Table2[State])
N8:N10N8=XLOOKUP($J8, Table2[[Name]:[Name]], Table2[abc])
 
Upvote 0

Forum statistics

Threads
1,224,891
Messages
6,181,614
Members
453,057
Latest member
LE102024

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