Unit 7 · Prepare your data

How to import Excel, CSV and Qualtrics data into SPSS

Import Excel and CSV files into SPSS, export Qualtrics data as .sav, and convert text answers to numeric codes with Automatic Recode.

Free tutorialPro practiceAbout 5 minutes7 practice questions

Quick answer: How do you import Excel, CSV and Qualtrics data into SPSS?

  1. Click File › Import Data › Excel (or CSV Data).
  2. Choose the worksheet and tick Read variable names from first row of data.
  3. Check the preview, then click OK.
  4. Turn any text answers into numeric codes with Transform › Automatic Recode.

Last updated November 2026 · Not sure this is the right test? Try the Which statistical test? tool.

Getting data into SPSS

Most data starts in Excel, a CSV file or an online survey such as Qualtrics. Importing well means each column arrives as the right type of variable, with sensible names, so the rest of your analysis goes smoothly.

When to use it

  • Data collected in Excel, Google Sheets or a survey platform.
  • Combining data from lab software that exports CSV files.

How it works

SPSS reads the first row as variable names (if you tick that option) and guesses each column’s type from its values. One stray word can make a numeric column text (String). After importing, check Variable View: types, names, value labels and Measure. Text answers such as “Male” can be converted to numeric codes with labels using Automatic Recode. Survey platforms such as Qualtrics can export straight to .sav, keeping question text and answer labels.

Worked example

A spreadsheet with headings in row 1 imports cleanly; a gender column holding “Male” and “Female” becomes a String variable, which Automatic Recode turns into 1 = Female, 2 = Male with value labels.

Key terms

CSV
Comma-separated values: a plain text table.
String
A text variable.
Automatic Recode
Converts text or numeric codes into consecutive numeric codes with labels.

Common mistakes

  • Merged cells, multiple header rows or notes in the spreadsheet.
  • Not checking Variable View after importing.
  • Numbers stored as text because of a stray character.

How to do it in SPSS

Read Excel File

Most data starts life in Excel or an online survey. File › Import Data › Excel brings a spreadsheet into SPSS and shows a preview before anything is imported.

Read Excel File
File: survey_export.xlsx
Worksheet: Sheet1 [A1:D121]1
✓Read variable names from first row of data2
Percentage of values that determine data type: 953
✓Ignore hidden rows and columns
Remove leading spaces from string values
Preview4
idgenderagescore
11Male2172
22Female3465
33Female1988
44Male2754
OKPasteResetCancelHelp
  1. 1
    WorksheetPick the sheet that holds the data, not a summary or chart sheet. The range shows which cells will be read.
  2. 2
    Variable names from first rowTick it when row 1 holds column headings. Otherwise SPSS treats the headings as a participant.
  3. 3
    Data typeSPSS decides whether each column is numeric or text from this percentage of values. One stray word can turn a number column into text.
  4. 4
    PreviewCheck it before clicking OK. Here gender came in as words (Male, Female), so it will be a String variable.

Tidy the spreadsheet first: one row per participant, one column per variable, headings in row 1, and nothing else on the sheet.

Automatic Recode

Text answers such as Male and Female can’t go into most analyses. Transform › Automatic Recode turns them into numeric codes and adds value labels for you.

Automatic Recode
Variables
Participant ID [id]
Age in years [age]
Variable -> New Name1
gender --> gender_n
New name: gender_n
Add New Name
Recode Starting from2
✓Lowest value
Highest value
✓Treat blank string values as user-missing3
OKPasteResetCancelHelp
  1. 1
    Variable and new nameMove the text variable across, type a new name and click Add New Name.
  2. 2
    Starting fromCodes are given in alphabetical order: Female = 1, Male = 2. The words become value labels automatically.
  3. 3
    Blank stringsEmpty cells become missing values instead of their own category.

The SPSS syntax

Prefer typing to clicking? Open File › New › Syntax, paste this in, select it and choose Run › Selection. Every dialog's Paste button writes the same kind of code.

* Import an Excel file (change the file path to yours).
GET DATA
  /TYPE=XLSX
  /FILE='C:\Users\you\Documents\survey_export.xlsx'
  /SHEET=name 'Sheet1'
  /CELLRANGE=FULL
  /READNAMES=ON
  /DATATYPEMIN PERCENTAGE=95.0.
EXECUTE.

* Turn text answers into numeric codes with value labels.
AUTORECODE VARIABLES=gender
  /INTO gender_n
  /BLANK=MISSING.

Practice data

Download the file used in this lesson and run it yourself in SPSS: you should get the same results as the screens above.

  • survey_export.xlsxThe same survey as an Excel file, with gender typed as words, for practising the import

Now practise it interactively →

Reading is only half of it. Tap through the real SPSS menus, read the output and pick the right write-up in 7 quick questions, with instant feedback on every answer.

Practice for this lesson is part of Pro, with every unit, unlimited hearts and saved progress.

More in Prepare your data