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.
Quick answer: How do you import Excel, CSV and Qualtrics data into SPSS?
- Click File › Import Data › Excel (or CSV Data).
- Choose the worksheet and tick Read variable names from first row of data.
- Check the preview, then click OK.
- Turn any text answers into numeric codes with Transform › Automatic Recode.
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
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.