Frequently asked questions - Calc
From The Document Foundation Wiki
How to convert relative to absolute coordinates quickly (effectively adding a '$')
When you type a formula, after having entered the coordinates (using keyboard or mouse), press F4.
Each press on this combination toggles the presence or absence of the '$' for the row, the column and, where appropriate, the sheet.