Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep one field fixed in a formular when using auto-fill?

Tags:

I want to autofill a formula to a bunch of fields in one column. I can do that by filling two fields manually then select them and drag down.

I want column B's cells to be =D1*A1 , =D1*A2,... Note D1 should not change.

When I drag the fields down or use (Edit > Fill...) it changes D1 to D2, D3,... How can I keep one field fixed for autofill?

Holding ctrl button down does not help.

Any idea?

like image 464
Seeker Avatar asked Jun 25 '12 19:06

Seeker


2 Answers

Make your "master" formula =D$1*A1. That flags the 1 in the D$1 part as being constant. You could also make the D part constant with =$D$1*A1, but since you stated this is a single column, it shouldn't matter in this case.

Note that this also works for Microsoft Excel, and I think that it's been a common feature of almost all spreadsheets since way back to supercalc on HDOS.

like image 77
twalberg Avatar answered Sep 22 '22 15:09

twalberg


I just found another way (that is not easier than twalberg's, but worth mentioning)...

You can define a name (Insert > Names... Define). Select a field and give it a name. Then the name in your formulas.

like image 37
Seeker Avatar answered Sep 24 '22 15:09

Seeker