Skip to main content

Coding and recoding data in Excel

This tutorial will help you re-code your data based on a reference coding table in Excel using the XLSTAT software.

Dataset to recode variables

The dataset contains 20 clients and their age, city of residence and gender. We will recode the variable City using a coding table.

Goal of this tutorial

The goal of this tutorial is to recode the variable City into the cardinal points North, South, East, West.

Recoding the data using a coding table

  • After opening XLSTAT, select the XLSTAT / Preparing data / Code command, or click on the corresponding button of the Preparing data toolbar.

  • Once you've clicked on the relevant button, the dialog box appears.

  • Select the variable you want to recode. Here we choose the variable "City" by selecting the whole column. Then select the coding table that contains both the old values and new values. Note that you should include the heading in the selection.

  • The output should be displayed as a new column in the table, so select the option Range and select a cell next to the table such as E1.

  • To avoid having text written above the results we untick the option Display the report header.

  • When ready click on the OK button. The results will now be displayed next to the table. You can verify that the code has been properly used.


This video shows you how to proceed with this tutorial.

Was this article useful?

  • Yes
  • No