HOW TO

Replace one value for another within a field

Last Published: June 3, 2021

Summary

The following instructions demonstrate how to use the Replace function in the Field Calculator tool to replace one value for another within a field in a table.

The example below uses a VBScript string function. For examples using a Python string function, refer to ArcMap: Simple calculations.

Procedure

  1. Add the table to ArcMap.
  2. Select Start Editing from the Editor menu.
  3. Open the table.
  4. Right-click the desired field heading in the table, and select Field Calculator.
  5. In the Field Calculator window, type the following function in the expression box:
replace()
  1. Place the cursor between the parentheses of the typed line.
  2. Double-click the name of the field from the Fields list to select it.
  3. Type a comma after the end bracket of the field name.
  4. Type the value to be replaced and the replacement value, and enclose each value in quotation marks and separate them with a comma. For example to replace the 'Wisconsin' value with the 'WI' value:
replace([FLD_name],"Wisconsin","WI")
  1. Click OK.

Article ID:000004254

Software:
  • ArcMap 10 x
  • ArcMap 9 x
  • ArcMap 8 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic