Overview for Recode

Use Recode to change values in one or more columns to new values. You can recode ranges of values, a set of individual values, or a single value. There are four recode commands: Recode to Numeric, Recode to Text, Recode to Date/Time, and Use Conversion Table.

Recode to Numeric

Recode numeric, text, or date/time values to numeric values. For example, in the following worksheet, gender (text data) is recoded to numbers: Female to 1 and Male to 2.

C1-T C2
Gender Recoded Gender
Female 1
Female 1
Male 2
Male 2
Female 1

Recode to Text

Recode numeric, text, or date/time values to text values. For example, in the following worksheet, numeric test scores are recoded to letter grades.

C1 C2-T
Scores Recoded scores
93 A
78 C
88 B
65 D

Recode to Date/Time

Recode numeric, text, or date/time values to date/time values. For example, in the following worksheet, the names of holidays are recoded to dates.

C1-T C2-D
Holiday Date
March Equinox March 20, 2016
June Solstice June 20, 2016
September Equinox September 22, 2016
December Solstice December 21, 2016

Use Conversion Table

Recode when you have a conversion table in the worksheet. For example, in the following worksheet, the names of the states are recoded to abbreviations using a conversion table. The conversion table is in the State and Abbreviation columns. The column to recode is Location.

C1-T C2-T C3-T C4-T
State Abbreviation Location Recoded Location
Alabama AL New Mexico NM
Arkansas AR Arkansas AR
Alaska AK Pennsylvania PA
Arizona AZ Ohio OH
... ...    

Where to find these commands

To recode data, choose one of the following:
  • Data > Recode > To Numeric
  • Data > Recode > To Text
  • Data > Recode > To Date/Time
  • Data > Recode > Use Conversion Table