Formula to Remove characters from a cell

RLJ

Active Member
Joined
Mar 15, 2011
Messages
417
Office Version
  1. 365
Platform
  1. Windows
I would like a formula to remove a possible zip code from a cell. I get data from a Client Database and want to remove the zip code from the cell as it is duplicated in another cell. All I want is the City/State.

Here is my problem... It is a client database so I do not have control over how the information is input. The field could inculde the zip+0000, just the zip, a blank field or it could be another part of the address. As indicated below.

Excel 2010
I
265NEW YORK, NY 10020
266LOS ANGELES, CA 90067-3100
267NEW YORK, NY 10022-2000
268NEW YORK, NY 10022
269NEW YORK, NY 10022
270NEW YORK, NY 10166
271NEW YORK, NY 10166
272
27325 MAIN STREET HACKENSACK

<COLGROUP><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
</TBODY>
Additional Contacts

As I see it the formula needs to look for a cell with a comma in it and then after 4 characters to the right remove it, and if no comma exisits, then copy original cell as is.

Thanks for your help!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
I ended up going with the VBA Function. It did not seem like the formulas presented here removed the zip from the string.

Thanks for all your help! MrExcel is a great community.
 
Upvote 0
I ended up going with the VBA Function. It did not seem like the formulas presented here removed the zip from the string.
I would be interested in seeing the text string which made the formula I posted in Message #8 not work... would you please post it back to this thread for me? Thanks.
 
Upvote 0

Forum statistics

Threads
1,215,409
Messages
6,124,743
Members
449,186
Latest member
HBryant

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