Skip to main content

shift_formula_references

Function shift_formula_references 

Source
pub fn shift_formula_references(formula: &str, op: ShiftOperation) -> String
Expand description

Shift cell references in a formula when rows/cols are inserted/deleted. Returns the updated formula string.

Rules:

  • Insert row at R: refs to row >= R become row + 1
  • Delete row at R: refs to row > R become row - 1; row == R becomes #REF!
  • Same logic for columns