IBM Support

How do I create a sum of different variables in SPSS for Windows?

Technote (FAQ)


Question

How do I create a sum of different variables in SPSS for Windows?

For example,

V1 V2 V3 V4 SUM
2 8 12 3 25

Answer

Use SUM function to sum variables in SPSS

e.g
Transform / Compute
Sum = SUM(v1,v2,v3,v4)

The Syntax for this would be:
COMPUTE sum = SUM(v1,v2,v3,v4) .
EXECUTE .

You can also do the following if you have more variables:
COMPUTE sum_all=SUM(v1 TO v102).
EXECUTE.

If you don't use the SUM function and instead just use:
SUM = V1 + V2 + V3 + V4

The resulting SUM variable will be a system missing value IF there are any system missings in any of the summed variables (v1, v2, v3 or v4)

Related information

Need more help? Our Statistics forum is Live!

Historical Number

21789

Document information

More support for: SPSS Statistics

Software version: Not Applicable

Operating system(s): Platform Independent

Reference #: 1476898

Modified date: 07 September 2016