From SPSS to Excel
Load an SPSS file (.sav / .zsav) – and get three Excel files: the data as codes (in the site's standard template, with a legend sheet built from the file's dictionary), the data as labels, and the data view. Ready for every calculator on the site – and also for those who do not have SPSS. Optionally: the questionnaire as a Word file completes the wording of the questions. The output: the variable table, documentation sentences, Word, and syntax that cross-checks and rebuilds.
Load an SPSS file
The questionnaire – optional
The SPSS file is enough. If you also attach the questionnaire as a Word file (.docx), the full wording of the question, the answer options and the filter instructions ("only those who answered yes to question 16") will go into the legend – because SPSS truncates long labels and does not keep the skip logic.
Options
When to use this page?
In two situations. The first – you have an SPSS data file (a survey institute, a panel, a previous study), and you want to run the site's calculators on it: every calculator reads Excel in the standard template – a row for each participant, a column for each variable, a header row first – and that is exactly the first file that comes out of here. The second – you do not have SPSS at all, and someone sent you a .sav. This file is a closed format: Excel does not open it, and without the software you cannot even know what the variable names are. The page opens it in the browser, with no installation and without sending the data anywhere, and returns everything SPSS knows about the file – in three Excel files.
Values without labels
The data as they are stored: 1 and 2, not "male" and "female". A "data" sheet – row = participant, column = variable, header row = the variable names – and next to it a legend sheet in the site's standard template, built from the dictionary of the SPSS file: the variable description (the label), the variable type (by measurement level: nominal / ordinal / scale), the coding (the value labels) and notes on defined missing values. This is the file you load into the calculators – they identify the variable types and the labels from it – and it is the file on which calculations are done in Excel.
Labels without values
The same data, but every code that has a label is replaced by the label: "male", "secular", "Northern District". Convenient for reading, filtering and pivot tables in Excel – but not for calculation, because the scales have become text.
Data view
The legend. The "Variables" sheet: for each variable – position, label, measurement level, format and defined missing values. The "Variable values" sheet: for each code – its label. This is what SPSS displays in Display Data File Information.
The sample data file
Those who want to try it without a file of their own can download the sample data file from the calculator card (in Hebrew or in English): this is the sample data file of the site's calculators – 120 participants, gender, age, education, study group, eight attitude items and a scale score – as SPSS would save it: with variable labels, value labels (1 = Male; 2 = Female), measurement levels according to the legend, format F8 for the codes and F8.2 for the scale score, and three values of "education" defined as a user-missing value (9 = Refused) – so that you can see what the checkbox does. After conversion, the "values without labels" file produced from it is identical in content to the calculators' sample data file, including the legend sheet.
How to read the output?
Table 1 in the output is a summary of the file, variable by variable, before anything is downloaded: what the format is (F8 – an integer of width 8; F8.2 – two decimal places; A255 – text of up to 255 characters; DATETIME20 – date and time), what measurement level was defined in SPSS (nominal, ordinal, interval – Nominal / Ordinal / Scale), how many valid observations there are, how many are missing, and how many value labels were defined. Note the measurement level column: many survey institutes leave all variables as Nominal (so too in the sample file on which the page was verified) – this is not evidence of the variable's type, but of a default that was not changed. Determine the variable type from the questionnaire. In version 2 this measurement level is what determines the "variable type" column in the legend sheet (Nominal → nominal, Ordinal → ordinal, Scale → scale), and the site's calculators follow it: a file whose variables are all Nominal will be loaded in them as a file of categorical variables only. Therefore, before conversion, it is worth correcting the Measure column in the SPSS variables window (Variable View) – or, after conversion, editing the "variable type" column in the legend sheet in Excel.
The "Variables" sheet in the data view returns what SPSS displays: Variable (name), Position (position in the file), Label (the label – the wording of the question, as entered), Measurement Level, Role (almost always Input), Column Width and Alignment (display only), Print Format and Write Format. If missing values were defined in the file, a Missing Values column is added. And if a questionnaire was attached – two columns are added: the full wording of the question (instead of the truncated label) and the instruction or filter that accompanied the question.
The "Variable values" sheet is the legend in the narrow sense: the variable name, the code and the label – Gender: 1 = Male, 2 = Female. In a multiple-selection variable (Q1_1 … Q1_9) each option is a separate variable with 0 = Not Selected, 1 = Selected, and the name of the option itself is in the variable label (the Label column in the first sheet) – not in the value labels.
Table 2 (when a questionnaire was attached) shows which question was matched to which variable. The matching is done by variable name: Q7 to question Q7; Q1_3 to option 3 of question Q1; Q2_4T to the free text of option 4 ("Other, please specify"). Variables whose name is not a question code – Gender, City, RECORDID – remain unmatched, and are listed in a note above the table. This is deliberate: a missing legend is better than a legend that guesses.
Downloading the output as Word (the export row) saves the variable table, the questionnaire matching table and the documentation sentences – a short document that documents the file, for the methodological appendix; the three Excel files are downloaded separately.
Assumptions and warnings
Two types of missing values. In SPSS there is system-missing (system-missing – an empty cell, a dot in the display) and user-missing (user-missing – a code the researcher defined as missing, for example 99 = "don't know"). System-missing always becomes an empty cell. User-missing – according to the checkbox: by default it becomes an empty cell, because that is how the site's standard template recognizes missing data, and every calculator on the site handles it like SPSS (pairwise or listwise deletion depending on the test). Without the checkmark the code remains, and then the calculators will treat it as a valid value – for example 99 in the mean of a 1-5 scale. The codes and their meaning are kept in any case in the data view.
Codes that are not missing but are not on the scale. "Other, please specify" (for example 6 on a 1-5 scale) and "refused" are valid values as far as SPSS is concerned if the researcher did not define them as missing – and they pass to Excel as they are. Before a correlation or a mean on such a variable, they must be removed (on the calculator page or in Excel). Table 1 helps identify them: the number of value labels is larger than the number of scale points.
Dates and times. SPSS stores a date as the number of seconds since October 14, 1582. The page converts it to a real Excel date (yyyy-mm-dd or yyyy-mm-dd hh:mm:ss, according to the variable's format), so that differences can be computed on it. A duration (TIME) becomes hours:minutes:seconds. Dates before March 1, 1900 get a one-day correction, because of Excel's fictitious leap year.
Long numbers remain text. A string variable that contains digits (an 18-digit record ID, for example) is written as text – on purpose. Excel keeps only 15 significant digits in a number, and an ID that was turned into a number would lose its last digits. A numeric variable is written as a number, in its print format: F8 without decimals, F8.2 with two.
Encoding. An SPSS file declares its encoding (UTF-8 in files from version 16 onward; windows-1255 in old Hebrew files), and the page reads according to the declaration. If the characters in the display look broken – the file declares an encoding that is not its real encoding (this happens in files that have moved between computers); write to us, and we will add a manual choice.
What does not carry over. Weights (WEIGHT) are mentioned in a warning but are not applied – the data come out unweighted, as in SPSS itself; multiple response sets (Multiple Response Sets), document notes (DOCUMENT) and custom variable attributes are not exported. Excel's limits – 1,048,576 rows and 16,384 columns – apply to the output; a file of a few hundred thousand cells is converted in seconds, a file of millions of cells will require memory and time.
And what about the opposite direction – from Excel back to SPSS? Excel does not keep labels, measurement levels and user-missing values, so an Excel file opened in SPSS arrives "bare". For this purpose the syntax file in the export row includes, after the cross-checking part, the dictionary commands: GET DATA from the "values without labels" file, followed by VARIABLE LABELS, VALUE LABELS, MISSING VALUES, FORMATS, VARIABLE LEVEL, width and alignment, and SAVE OUTFILE. Someone who received only the Excel files and the .sps file can rebuild a fully labeled SPSS file. Two caveats: user-missing values that were emptied in the export return as system-missing (the original definition is kept in the MISSING VALUES command for documentation); and labels exactly 256 bytes long – the SPSS maximum – are kept in SPSS, but PSPP truncates them by one byte.
And how do you do it in SPSS?
A note on versions. The procedures and commands in this section were checked against SPSS Statistics version 29 – the version in which the sample file and the three reference files against which the page was verified were created. The procedures themselves are stable across versions; menu locations and option names may change slightly, and in versions older than 16 the .sav file is saved in the system encoding (Hebrew – windows-1255) and not in UTF-8.
The two data files – File › Save As…, in the Save as type field choose Excel 2007 through 2010 (*.xlsx). The Write variable names to spreadsheet checkbox stays checked (otherwise there is no header row), and the Save value labels where defined instead of data values checkbox determines which of the two comes out: unchecked – "values without labels"; checked – "labels without values". The name of the sheet in the file is the name of the dataset in SPSS; here – "data", as in the standard template, and next to it a legend sheet (which SPSS does not produce – its legend is exported separately, in the data view).
CD 'C:\Rdata'. SAVE TRANSLATE OUTFILE='data_values.xlsx' /TYPE=XLS /VERSION=12 /MAP /REPLACE /FIELDNAMES /CELLS=VALUES. SAVE TRANSLATE OUTFILE='data_labels.xlsx' /TYPE=XLS /VERSION=12 /MAP /REPLACE /FIELDNAMES /CELLS=LABELS.
The data view – File › Display Data File Information › Working File. The output window shows two tables, Variable Information and Variable Values; export them to Excel with File › Export… with Type: Excel, and each table becomes a sheet. In syntax:
DISPLAY DICTIONARY. OUTPUT EXPORT /CONTENTS EXPORT=VISIBLE /XLSX DOCUMENTFILE='data_dictionary.xlsx' SHEET='Variables' LOCATION=LASTCOLUMN.
The "Download SPSS syntax" button (SPSS) in the export row downloads a file in two parts. Part A – these three commands, with the name of the file that was loaded, headed by a single CD 'C:\Rdata'. line (the site convention – update your folder in it, and the path is not repeated in the other commands), in order to cross-check: what the page produced in the browser against what SPSS produces from the same file; this is how the page itself was verified, cell by cell. Part B – the dictionary commands: loading the "values without labels" file and restoring the labels, missing values, measurement levels and formats, and saving as .sav. This block is a standard component of the site (master design 14): every page that knows something about the variables – from the legend sheet or from an SPSS file – adds it to its syntax.
GET DATA /TYPE=XLSX
/FILE='data – values without labels.xlsx'
/SHEET=name 'data' /CELLRANGE=FULL /READNAMES=ON.
VARIABLE LABELS
Gender 'Indicate your gender:'
Q7 'A community neighborhood is a neighborhood in which residents are involved…'.
VALUE LABELS
/Gender
1 'Male'
2 'Female'.
MISSING VALUES score (99).
FORMATS Gender (F8) score (F8.2).
VARIABLE LEVEL Gender (NOMINAL).
SAVE OUTFILE='data – restored.sav'.
References
Free Software Foundation. (n.d.). System file format. In GNU PSPP user's guide. https://pspp.benpfaff.org/manual/system-file.html
IBM. (2022). IBM SPSS Statistics 29 command syntax reference. https://www.ibm.com/docs/en/SSLVMB_29.0.0/pdf/IBM_SPSS_Statistics_Command_Syntax_Reference.pdf
The open documentation of PSPP is the specification according to which the file decoder was built (the record structure, compression, very long strings); the IBM syntax reference – the source for the SAVE TRANSLATE, DISPLAY and OUTPUT EXPORT commands in the SPSS section. Both are digital copies and are cited by section.