Find and Replace Formulas in SharePoint Calculated Columns

Find and Replace Formulas in SharePoint Calculated Columns

Something often overlooked during migrations are calculated fields in SharePoint Lists. In lots of tools available, the value of a calculated field migrates correctly from one environment to the next. The problem though, is in one environment this formula may have pointed to a URL or static asset as part of the formula. After this column is migrated the formula is technically correct, just inaccurate in the new SharePoint environment.

Following a migration from SharePoint 2007 to SharePoint 2013, my colleague was looking for a way to update formulas across SharePoint sites which had references to the old domain. He essentially needed a “Find and Replace” function for columns in SharePoint. Now this is not probably the smartest or the best solution to this problem, it is however, a solution.

Powershell Function:

And voila, you have a simple way to find and replace any text value inside of a SharePoint list. While I have only tested this with SharePoint 2013, it should work in SharePoint 2010 and SharePoint 2016 if that’s your thing.

Feel free to post questions or feedback on this article, and improvements if I have botched anything.

3 thoughts on “Find and Replace Formulas in SharePoint Calculated Columns

    1. Hey Matt! Not sure why it would not. I am curious now though and Will run a test and find out. How big of a list are we talking about?

      1. Really big! Brian Jackett has a PowerShell script to create a large list, full of random data.

        I asked because I vaguely remember getting a list view threshold error when trying to change a calc within the GUI.

Leave a Reply

Your email address will not be published. Required fields are marked *