Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-27-2007, 02:46 PM
=?Utf-8?B?S2FybCBI?=
 
Posts: n/a
Eliminate trailing zeros in zip codes

If a zip code ends with 4 zeros, I'd like to eliminate them and have the zip
code just be 5 numbers (or text). I'm not sure how to do this If/then
statement. Here's what I have (which doesn't work).

=IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))

Thank you in advance for any help.
Karl

Reply With Quote
  #2 (permalink)  
Old 11-27-2007, 02:56 PM
Peo Sjoblom
 
Posts: n/a
Re: Eliminate trailing zeros in zip codes

Maybe

=IF(AND(LEN(J2)=10,RIGHT(J2,4)="0000"),LEFT(J2,5), J2)



--


Regards,


Peo Sjoblom



"Karl H" <KarlH@discussions.microsoft.com> wrote in message
news:DA4CB5F3-A90D-4DC2-A1CD-6AE4DA8CD2A1@microsoft.com...
> If a zip code ends with 4 zeros, I'd like to eliminate them and have the
> zip
> code just be 5 numbers (or text). I'm not sure how to do this If/then
> statement. Here's what I have (which doesn't work).
>
> =IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))
>
> Thank you in advance for any help.
> Karl
>



Reply With Quote
  #3 (permalink)  
Old 11-27-2007, 03:14 PM
=?Utf-8?B?S2FybCBI?=
 
Posts: n/a
Re: Eliminate trailing zeros in zip codes

Thank you, but it didn't work. That turned "32401" to 00003-2401 and
324010000 to 32401-0000.
I wonder if the "0000" is just being interpreted as any 4 numeric characters?

"Peo Sjoblom" wrote:

> Maybe
>
> =IF(AND(LEN(J2)=10,RIGHT(J2,4)="0000"),LEFT(J2,5), J2)
>
>
>
> --
>
>
> Regards,
>
>
> Peo Sjoblom
>
>
>
> "Karl H" <KarlH@discussions.microsoft.com> wrote in message
> news:DA4CB5F3-A90D-4DC2-A1CD-6AE4DA8CD2A1@microsoft.com...
> > If a zip code ends with 4 zeros, I'd like to eliminate them and have the
> > zip
> > code just be 5 numbers (or text). I'm not sure how to do this If/then
> > statement. Here's what I have (which doesn't work).
> >
> > =IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))
> >
> > Thank you in advance for any help.
> > Karl
> >

>
>
>

Reply With Quote
  #4 (permalink)  
Old 11-27-2007, 03:20 PM
Peo Sjoblom
 
Posts: n/a
Re: Eliminate trailing zeros in zip codes

No it does not turn 32401 to 00003-2401, That is just the display not the
real values. You didn't say these were numerical values, all you have to do
if they are numerical values is to change the format to 00000




--


Regards,


Peo Sjoblom


"Karl H" <KarlH@discussions.microsoft.com> wrote in message
news:3B4008B2-80E1-4306-BB96-9B3F075B38E1@microsoft.com...
> Thank you, but it didn't work. That turned "32401" to 00003-2401 and
> 324010000 to 32401-0000.
> I wonder if the "0000" is just being interpreted as any 4 numeric
> characters?
>
> "Peo Sjoblom" wrote:
>
>> Maybe
>>
>> =IF(AND(LEN(J2)=10,RIGHT(J2,4)="0000"),LEFT(J2,5), J2)
>>
>>
>>
>> --
>>
>>
>> Regards,
>>
>>
>> Peo Sjoblom
>>
>>
>>
>> "Karl H" <KarlH@discussions.microsoft.com> wrote in message
>> news:DA4CB5F3-A90D-4DC2-A1CD-6AE4DA8CD2A1@microsoft.com...
>> > If a zip code ends with 4 zeros, I'd like to eliminate them and have
>> > the
>> > zip
>> > code just be 5 numbers (or text). I'm not sure how to do this If/then
>> > statement. Here's what I have (which doesn't work).
>> >
>> > =IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))
>> >
>> > Thank you in advance for any help.
>> > Karl
>> >

>>
>>
>>



Reply With Quote
  #5 (permalink)  
Old 11-27-2007, 05:13 PM
*alan*
 
Posts: n/a
Re: Eliminate trailing zeros in zip codes


"Karl H" <KarlH@discussions.microsoft.com> wrote in message
news:DA4CB5F3-A90D-4DC2-A1CD-6AE4DA8CD2A1@microsoft.com...
> If a zip code ends with 4 zeros, I'd like to eliminate them and have the
> zip
> code just be 5 numbers (or text). I'm not sure how to do this If/then
> statement. Here's what I have (which doesn't work).
>
> =IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))
>
> Thank you in advance for any help.
> Karl
>

How about just using the Find and Replace function (CTRL+F) ??

Assuming your zipcodes are expressed normally (i.e. 12345-1234 and
12345-0000):

Find what: enter -0000
Replace with: leave blank
Click "Replace All"
--
alan

Reply With Quote
  #6 (permalink)  
Old 11-27-2007, 06:04 PM
=?Utf-8?B?S2FybCBI?=
 
Posts: n/a
Re: Eliminate trailing zeros in zip codes

Thanks, Peo...that should do it.
Karl

"Peo Sjoblom" wrote:

> No it does not turn 32401 to 00003-2401, That is just the display not the
> real values. You didn't say these were numerical values, all you have to do
> if they are numerical values is to change the format to 00000
>
>
>
>
> --
>
>
> Regards,
>
>
> Peo Sjoblom
>
>
> "Karl H" <KarlH@discussions.microsoft.com> wrote in message
> news:3B4008B2-80E1-4306-BB96-9B3F075B38E1@microsoft.com...
> > Thank you, but it didn't work. That turned "32401" to 00003-2401 and
> > 324010000 to 32401-0000.
> > I wonder if the "0000" is just being interpreted as any 4 numeric
> > characters?
> >
> > "Peo Sjoblom" wrote:
> >
> >> Maybe
> >>
> >> =IF(AND(LEN(J2)=10,RIGHT(J2,4)="0000"),LEFT(J2,5), J2)
> >>
> >>
> >>
> >> --
> >>
> >>
> >> Regards,
> >>
> >>
> >> Peo Sjoblom
> >>
> >>
> >>
> >> "Karl H" <KarlH@discussions.microsoft.com> wrote in message
> >> news:DA4CB5F3-A90D-4DC2-A1CD-6AE4DA8CD2A1@microsoft.com...
> >> > If a zip code ends with 4 zeros, I'd like to eliminate them and have
> >> > the
> >> > zip
> >> > code just be 5 numbers (or text). I'm not sure how to do this If/then
> >> > statement. Here's what I have (which doesn't work).
> >> >
> >> > =IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))
> >> >
> >> > Thank you in advance for any help.
> >> > Karl
> >> >
> >>
> >>
> >>

>
>
>

Reply With Quote
  #7 (permalink)  
Old 11-27-2007, 06:04 PM
=?Utf-8?B?S2FybCBI?=
 
Posts: n/a
Re: Eliminate trailing zeros in zip codes

I like it--easier than code-thank you!
Karl

"*alan*" wrote:

>
> "Karl H" <KarlH@discussions.microsoft.com> wrote in message
> news:DA4CB5F3-A90D-4DC2-A1CD-6AE4DA8CD2A1@microsoft.com...
> > If a zip code ends with 4 zeros, I'd like to eliminate them and have the
> > zip
> > code just be 5 numbers (or text). I'm not sure how to do this If/then
> > statement. Here's what I have (which doesn't work).
> >
> > =IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))
> >
> > Thank you in advance for any help.
> > Karl
> >

> How about just using the Find and Replace function (CTRL+F) ??
>
> Assuming your zipcodes are expressed normally (i.e. 12345-1234 and
> 12345-0000):
>
> Find what: enter -0000
> Replace with: leave blank
> Click "Replace All"
> --
> alan
>
>

Reply With Quote
  #8 (permalink)  
Old 11-27-2007, 07:12 PM
Ron Rosenfeld
 
Posts: n/a
Re: Eliminate trailing zeros in zip codes

On Tue, 27 Nov 2007 06:46:04 -0800, Karl H <KarlH@discussions.microsoft.com>
wrote:

>If a zip code ends with 4 zeros, I'd like to eliminate them and have the zip
>code just be 5 numbers (or text). I'm not sure how to do this If/then
>statement. Here's what I have (which doesn't work).
>
>=IF(J2 Right(="0000"), Text("00000"), Text("00000/-####))
>
>Thank you in advance for any help.
>Karl


If your ZIP codes are entered as numbers, then you can either use the custom
format:

Format/Cells/Number/Custom Type: [<100000]00000;00000-0000

OR the formula:

=TEXT(A1,"[<100000]00000;00000-0000")


--ron
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:54 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Debt Consolidation | Pontins | Blog Contests | Kelly blue book | Pet Insurance



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114