LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2002)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 25 Mar 2002 11:18:27 -0500
Reply-To:     Mark Casazza <>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Mark Casazza <>
Subject:      Re: Please remind me ....
Comments: To: Staffan Lindberg <>
In-Reply-To:  <A144B3611B47D21193330008C7246B760117CEDB@FHIEXNT0>
Content-Type: text/plain; charset="iso-8859-1"

Hi Staffan,

Even if you make the variable a string in SPSS Excel will see it as number and discard the leading zeros. The easiest way to fix this is in Excel. Select the column with the variable, right click and select format cells, then go to the number tab and select custom. In the Type box, type 0000 (four zeros). This will force Excel to display leading zeros for any number with three or fewer digits (at four digits you don't need the leading zeros).


Mark V. Casazza Director of Academic Information The City University of New York 555 W. 57th St. 16th Floor New York, NY 10019

phone: 212.541.0396 fax: 212.541.0392 email:

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of Staffan Lindberg Sent: Monday, March 25, 2002 11:03 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Please remind me ....

Hi listers !

I know I have seen this before in this list but cannot find it now.

I have a 1-4 digit numerical variable in SPSS. I would like to convert it into a 4 character string variable (right justified) with leading zeros.. I want to later export this to Excel keeping the variable with leading zeros.

I managed to fix it in SPSS with the Nw-format but after export to Excel, no leading zeros showed.

Thankful for any help

Staffan Lindberg National Institute of Public Health Sweden

Back to: Top of message | Previous page | Main SPSSX-L page