"Find" and "Replace" Help Needed

traffictrader

New Member
Joined
Oct 3, 2014
Messages
2
Hi Everyone,


This is my first post here on the forum.

As a novice user of Excel, it is so great this forum exists.


Thanks in advance for any help.


I have a large spreadsheet of US zip codes that needs to be cleaned up.


Question #1:


Some are in the 5 digit format (which I need) Eg: 90210 and some are in the 4 digit format eg: 4536


Is there a way to add a zero in front of all the 4 digit format zip codes using the Find and Replace function? Or is there some other way to do this?




Question #2:


The US Post Office sometimes places a 4 digit extra code after the standard 5 digit code Eg: 90210-9876


Is there a way to easily delete all the 4 digit extra codes and just keep the standard 5 digit codes?


Thanks again for any help on this.


Cheers,


Ralf
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
To your first question....not really. Unfortunately for zip codes, excel treats them as a number. So it will trim the leading zero. If you need it to LOOK like it has the leading zero, you can do that with custom formatting/conditional formatting. If you need it to have the leading zero, you'll have to convert the numbers to text. Or, on the import, import them as text. But you can use a simple formula if you can spare a helper column.

Code:
=IF(LEN(Q29)=4,"0"&Q29,Q29)

As for your second question, yes.

Find: "-*"
Replace:
 
Upvote 0
To your first question....not really. Unfortunately for zip codes, excel treats them as a number. So it will trim the leading zero. If you need it to LOOK like it has the leading zero, you can do that with custom formatting/conditional formatting. If you need it to have the leading zero, you'll have to convert the numbers to text. Or, on the import, import them as text. But you can use a simple formula if you can spare a helper column.

Code:
=IF(LEN(Q29)=4,"0"&Q29,Q29)

As for your second question, yes.

Find: "-*"
Replace:

Thank you NeonRedSharpie...I will give this a try.
 
Upvote 0

Forum statistics

Threads
1,214,932
Messages
6,122,334
Members
449,077
Latest member
Jocksteriom

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top