Locking cell references in a formula

I want to copy/paste cells with a formula that needs to move with the paste, however one of the references needs to stay pointing at a static column. In Excel, I would use $A1 as the cell reference. In Smartsheet, I don't see a way to do that.
Best Answer
-
It is the same in Smartsheet. Use a $ to lock in an absolute reference whether that be before the column name to lock in the column, the row number to lock in the row, or both to lock in both.
$[Column Name]1
[Column Name]$1
$[Column Name]$1
Answers
-
In Smartsheet, it's as easy as naming the column. In Excel, column A is always the first column and Column B is always the second column, even if you rearrange things. In Smartsheet, the name is the name is the name, regardless of how you arrange your sheet.
In terms of how to reference similar to $A1 (locking to a COLUMN but not a ROW)… consider this example. Column1 is your Primary column - which you might rename to "Order Number", Column 2 might be renamed to "Sales Amount", and so on. Assume that you want to compute the tax (which let's pretend is 5%) on each line. You could then create a column called "Tax"… and then another column that's the sales amount + tax, called "Total". The formulas would be:
Tax: =[Sales Amount]@row*0.05
Total: =[Sales Amount]@row + Tax@rowDoesn't matter where you put "Tax" or "Total." The formulas will work. If you rearrange the columns, the above will still work. (Though you'll also run into issues if you use things like VLOOKUP, but that's a whole other topic.)The whole @row thing is essentially a variable that means "find the value ON THIS ROW for whatever column… and then do things. Also notice the square brackets [] — the reason for that is the SPACE in the column name. If there's anything but letters in the name, you need to put the square brackets around the column name; if it's just letters, the brackets are optional.
Here is a bit more on @row:
https://community.smartsheet.com/discussion/100275/how-to-index-match
community post about INDEX/MATCHGood luck!
If this answer resolves your question, please help the Community by marking it as an accepted answer. I'd also be grateful for your response - "Insightful"or "Awesome" reactions are much appreciated. Thanks!
-
Hi Kerry,
I name all my columns. I have a sheet that I was copying a cell with a formula in it to move it to another area. The columns repeat ([Change Date 1]@row, [Change Date 2]@row, etc.) so if I copy the cell and paste it to the right, all the references are relative and update to their new locations. That's exactly what I want it to do…except for one cell reference (e.g. [Initial Date]@row). I need that reference to remain the same with each new paste.
The workflow is either to copy/paste the cell and go back to fix the one reference in each cell (this is replicated 20 times). Or, I open the cell and copy/paste the formula, but then I have to go back and fix the other references that I want to change with each paste.
In Excel, there's a way to lock a single reference in a formula that is otherwise relative to the location of the cell where the formula is moved to.
I'm sure there is a better way to explain what I'm doing, but I'm not sure how. I ended up pasting the cells into my sheet and going back to fix the one reference in each cell. It was painful and I'd love to not have that issue in the future.
-
It is the same in Smartsheet. Use a $ to lock in an absolute reference whether that be before the column name to lock in the column, the row number to lock in the row, or both to lock in both.
$[Column Name]1
[Column Name]$1
$[Column Name]$1
-
Now I feel dumb that I didn't just try that. Thank you!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 67.2K Get Help
- 452 Global Discussions
- 155 Industry Talk
- 505 Announcements
- 5.4K Ideas & Feature Requests
- 85 Brandfolder
- 156 Just for fun
- 81 Community Job Board
- 514 Show & Tell
- 34 Member Spotlight
- 2 SmartStories
- 308 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!