Date: Mon, 25 Mar 2002 11:18:27 -0500
Reply-To: Mark Casazza <Mark.Casazza@domino1.cuny.edu>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Mark Casazza <Mark.Casazza@domino1.cuny.edu>
Subject: Re: Please remind me ....
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).
HTH
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: Mark.Casazza@mail.cuny.edu
-----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