DEV Community

Franz Wong
Franz Wong

Posted on

2 1

Excel tips - lock column and row in formula

Suppose I would like to do something like this.

Alt Text

Instead of calculating interest by hand, of course we should use formula to do that.

We can put =A2*B2/100, =A2*B3/100 and =A2*B4/100 to C2, C3 and C4 respectively. But it is troublesome to prepare different formulas for each row.

Instead, we can use $ to lock both column index and row index for A2, so when we "paste" the formula, Excel will update the row index of B for us.

We put =$A$2*B2/100 to C2 and copy C2.

Alt Text

When we paste the copied C2 to C3, we will get =$A$2*B3/100 without additional modification.

Alt Text

But still, we need to keep pasting the formula to other cells. We can simply drag the small dot at the right bottom corner of the cell to the cells you want it to copy to.

Alt Text

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay