Forum Discussion

bhauteshved's avatar
bhauteshved
Copper Contributor
Jul 07, 2025
Solved

Replace all formulas based on a pattern

I have several formulas in my worksheet that follow a similar pattern.    The formula is as follows.  =IFERROR(INDEX('Data Tab'!O:O,MATCH(TEXT(A350,"0"),'Data Tab'!E:E,0))*C350,0) I want replace ...
  • m_tarler's avatar
    Jul 07, 2025

    That depends on what else is in your workbook.  The key is to make a 'Find' that you are sure is unique to only the cases you want to change.  I assume the problem is that the A350 in this example may change but you still want to remove the TEXT.  What about the column O:O just before the MATCH and the 'Data Tab'!... after the TEXT() function? will those change also?

    Assuming the ",MATCH(TEXT(" portion is unique to what you want I would try:

    FIND:    ,MATCH(TEXT(

    click FINDALL and see how many it finds 

    Then repeat with 

    FIND:     ,"0"), 

    click FINDALL and see if that total matches the above.

    If so then use those finds to replace:     

    ,MATCH(TEXT(    goes to   ,MATCH(

    ,"0"),                    goes to   ,

    But if that doesn't work (i.e. there are many more cases of  ,"0"),  or both then maybe:

    if you just want that formula to use a NUMBER instead of TEXT maybe force it back to be a number:

    FIND:    ,MATCH(TEXT(

    REPLACE WITH:   ,MATCH(--TEXT(

    so it will convert to text and then convert back to a number, but if it wasn't a recognizable number then it will cause an error.

    BTW the new excel has new functions like XMATCH and XLOOKUP that you might consider. For example that formula would likely simplify to

    =XLOOKUP( A350, 'Data Tab'!E:E, 'Data Tab'!O:O, 0) * C350

     

     

Resources