Knowledge Base - Technical Articles

Technical Article   HowTo:  Replace one value for another within a field

Article ID: 20119
Software:  ArcGIS - ArcEditor 8.3, 8.1.2, 8.2, 9.0, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcInfo 8.2, 9.0, 8.0.1, 8.0.2, 8.1.2, 8.3, 9.1, 9.2, 9.3, 9.3.1 ArcGIS - ArcView 8.3, 8.1.2, 8.2, 9.0, 9.1, 9.2, 9.3, 9.3.1
Platforms: N/A


Instructions provided demonstrate how to use the Replace function in the Field Calculator, to replace one value for another within a field in a table.


  1. Load the table into ArcMap.
  2. Select Start Editing from the Editor menu.
  3. Open the table.
  4. Right-click the desired field.
  5. Select Field Calculator.
  6. Type the following in the expression box:


  7. Place the cursor between the parenthesis of the line just typed.
  8. Select the name of the field from the Fields list.
  9. Type a comma after the end bracket surrounding the field name.
  10. Type the value to be replaced and the replacement value; enclose each value in quotation marks and separate with a comma. For example:


  11. Click OK.

Created: 7/27/2001
Last Modified: 5/3/2011

Article Rating: (3)
If you would like to post a comment, please login


By arulkumar4 - 02/09/2016 1:55 AM

Other - See details below.

I'm getting error "Invalid use of Null:'replace'" when using replace([FLD_name], 0, Null). What is the issue?


By Anonymous - 02/16/2011 9:02 AM

The article needs to be updated.

To answer the geohaskett comment, you can mimic a multiple replace function with an If, ElseIf statement. Ex. If you want to replace values in a name field you might check the show code book, and declare and set parameters for a replacement variable, like this: replacement= "replaceText" If [name]="textToReplace1" Then replacement= "replacementText1" ElseIf [name]="textToReplace2" Then replacement= "replacementText2" Else replacement= "fail" End If name = replacement


By Anonymous - 07/08/2010 1:49 AM

I would like to see a new article that discusses the topic outlined below.

Can you include how to do multiple Replace functions back to back?