From The Document Foundation Wiki
If you want to retrieve the formula but not to adapt the references, you can:
- Press F2 in the cell that contains the formula
- Select the formula in the dislayed input area
- Press Esc to leave the input area
- Select the target cell
- Press F2 to display the input area and paste.