#REF! means a cell reference is invalid — usually because the rows/columns/sheets it pointed to were deleted, or a cut-and-paste overwrote the reference.
Undo the deletion
If you just deleted cells, press Ctrl+Z and adjust references first.
Rebuild the reference
Re-point the formula to the correct existing cells.
Use structured references
Convert ranges to a Table so references survive edits.
Formulas that referenced that column lost their target. Restore it or repoint the formula.