33

Say I have 2 columns: (this is extremely simplified)

  • Data = a number
  • Result = Data * 1.2

I can put B2 = A2*1.2, then drag and drop B2 down...
enter image description here
and it fills all the other cells, which is perfect.
enter image description here

But can I put this multiplier (1.2) somewhere as a "constant"? (for clarity and being easily editable)

Say I put it in E1, and set B2 = A2*E1.
Now I can't drag and drop anymore (because E1 becomes E2 E3 and so on)
enter image description here
In this example, is there a way to make E1 stay as you drag it down?

marikamitsos
  • 10,264
  • 20
  • 26
Aximili
  • 28,626
  • 56
  • 157
  • 216

3 Answers3

64

Short answer

Use an absolute cell reference or a named range

Explanation

Instead of E1, which is a relative cell reference, use $E$1 which is an absolute cell reference.

An alternative is to to assign a name to the cell E1, let say, "constant"

In the first case the formula will be

=A2*$E$1

In the second case

=A2*constant 

References

Rubén
  • 34,714
  • 9
  • 70
  • 166
4

I understand that you are asking for "A “constant” in Google spreadsheet?" and later on a "drag down" solution.

You can use the accepted answer, OR ...
Instead of having to drag down (increasing the number of formulas)

Use a single formula in B2

=ArrayFormula(A2:A6*E1)  

enter image description here

You can even use it for future entries or now blank cells.

=ArrayFormula(IF(A2:A11<>"",A2:A11*E1,""))

enter image description here

How the formula works

The ArrayFormula will apply the calculation cell*E1 in every single row, IF the cell is not empty/blank "".
IF it is a blank cell it will return a blank cell "".

Functions used:

marikamitsos
  • 10,264
  • 20
  • 26
  • 2
    A superb solution for working with large datasets where dragging down would be infeasible (and where empty cells prevent auto-fill)! – Michael McGreal Jul 27 '22 at 00:23
2

Can you try this in your formula?

Cell B2 type

 =A2*$E$1

Then there is no need to drag it down on column E, it will all follow E1. I believe this solves the problem.

If you really want to drag it down, then why not just put Cell E2

=E1

So that even when you drag, the value will remain 1.2

Kelvin Chong
  • 222
  • 1
  • 3
  • 17