Locking a cell reference to a cell location

jimp823

New Member
Joined
May 10, 2016
Messages
7
Hi,

I have a spreadsheet where I am comparing two lists of chronological transactions based on their amount. For example column B has an amount for the transaction from the first list and column D has a transaction from the second list. In column C I have the formula '=B1-D1' and if they sum to 0 I know they match.

If they don't sum to zero, that means there's another transaction in one of the lists that isn't in the other list, and I can identify the missing transaction. I then insert cells above the list with the missing transaction so that the next set of transactions align. However, when the list of transactions shifts down, the formula in column C changes the cell target to move with it. Ex. If I shift down the list in column D starting in row 2, the formula changes from '=B2-D2' to '=B2-D3'.

Is there a way to lock the formula in Column C so that is stays the same no matter what I do with the other columns?

Right now, the only way I can continue auditing my transactions is by recopying the formula down column C to the bottom again.

Here's what the table looks like:

[TABLE="width: 771"]
<tbody>[TR]
[TD]Transaction Name[/TD]
[TD]Amount[/TD]
[TD] Sum[/TD]
[TD]Amount[/TD]
[TD]Transaction Name[/TD]
[/TR]
[TR]
[TD]Transaction 1[/TD]
[TD]6[/TD]
[TD]0[/TD]
[TD]6[/TD]
[TD]Transaction 1[/TD]
[/TR]
[TR]
[TD]Transaction 2[/TD]
[TD]7[/TD]
[TD]4[/TD]
[TD]3[/TD]
[TD]Transaction 3[/TD]
[/TR]
[TR]
[TD]Transaction 3[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]1[/TD]
[TD]Transaction 4[/TD]
[/TR]
[TR]
[TD]Transaction 4[/TD]
[TD]1[/TD]
[TD]-3[/TD]
[TD]4[/TD]
[TD]Transaction 5[/TD]
[/TR]
[TR]
[TD]Transaction 5[/TD]
[TD]4[/TD]
[TD]-4[/TD]
[TD]8[/TD]
[TD]Transaction 6[/TD]
[/TR]
</tbody>[/TABLE]


Here's what it looks like after I've shifted the cells in columns D and E down to match up:

[TABLE="width: 771"]
<tbody>[TR]
[TD]Transaction Name[/TD]
[TD]Amount[/TD]
[TD][/TD]
[TD]Amount[/TD]
[TD]Transaction Name[/TD]
[/TR]
[TR]
[TD]Transaction 1[/TD]
[TD]6[/TD]
[TD]0[/TD]
[TD]6[/TD]
[TD]Transaction 1[/TD]
[/TR]
[TR]
[TD]Transaction 2[/TD]
[TD]7[/TD]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Transaction 3[/TD]
[TD]3[/TD]
[TD]2[/TD]
[TD]3[/TD]
[TD]Transaction 3[/TD]
[/TR]
[TR]
[TD]Transaction 4[/TD]
[TD]1[/TD]
[TD]-3[/TD]
[TD]1[/TD]
[TD]Transaction 4[/TD]
[/TR]
[TR]
[TD]Transaction 5[/TD]
[TD]4[/TD]
[TD]-4[/TD]
[TD]4[/TD]
[TD]Transaction 5[/TD]
[/TR]
</tbody>[/TABLE]


And here's what I need, which right now I can only acheive by recopying the formula from C2 all the way down the column again:

[TABLE="width: 771"]
<tbody>[TR]
[TD]Transaction Name[/TD]
[TD]Amount[/TD]
[TD]Sum[/TD]
[TD]Amount[/TD]
[TD]Transaction Name[/TD]
[/TR]
[TR]
[TD]Transaction 1[/TD]
[TD]6[/TD]
[TD]0[/TD]
[TD]6[/TD]
[TD]Transaction 1[/TD]
[/TR]
[TR]
[TD]Transaction 2[/TD]
[TD]7[/TD]
[TD]7[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Transaction 3[/TD]
[TD]3[/TD]
[TD]0[/TD]
[TD]3[/TD]
[TD]Transaction 3[/TD]
[/TR]
[TR]
[TD]Transaction 4[/TD]
[TD]1[/TD]
[TD]0[/TD]
[TD]1[/TD]
[TD]Transaction 4[/TD]
[/TR]
[TR]
[TD]Transaction 5[/TD]
[TD]4[/TD]
[TD]0[/TD]
[TD]4[/TD]
[TD]Transaction 5[/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
In C2, copied down
=B2-OFFSET(C2,0,1)

Note though that OFFSET & INDIRECT are volatile functions so can slow your sheet if used a lot.
If you wanted to avoid the volatile function you could instead use
=B2-INDEX(D:D,ROW())
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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