Forum Discussion

WendyVN's avatar
WendyVN
Copper Contributor
Oct 18, 2024
Solved

Find and Replace Formulas

I have a simple formula that I only want to find replace one mathematical sign.  I have many cells with the original formula and multiple s.  I tried using the * in place of the cell name and it did ...
  • m_tarler's avatar
    Oct 18, 2024

    WendyVN  maybe there is another way but this might work for you if they are all in the same column:

    1) convert worksheet to R1C1 style

    2) find & replace

    3) convert workshet back to A1 style

    so step 1 is go into excel options select formulas section and click the checkbox for R1C1 style.  See image below

     

    now all the formulas will look something like =RC[-5]+RC[-4]-RC[-3]

    highlight that formula and go into find and replace and paste that into the find

    under replace you can change the + to - so it will be =RC[-5]-RC[-4]-RC[-3]

     

    then go back into options and unclick the R1C1 checkbox.

     

    For the future consider using array formulas so =A1:A100 + B1:B100 - C1:C100 which will do the calculation on all 100 rows and then if you need to change you only change the 1 cell.

    Or better yet you can use LAMBDA so you define a LAMBDA function like MyCalc

    MyCalc := LAMBDA(a,b,c, a+b-c)

    then you have =MyCalc(A1, B1, C1) or =MyCalc(A1:A100, B1:B100, C1:C100) in the formula boxes.  Then if you need to change the calculation you go back into your Name Manager and change the definition of MyCalc to be MyCalc := LAMBDA(a,b,c, a-b-c) and then all cases of that are corrected.

     

     

Resources