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
NEW YORK, NY 10020
LOS ANGELES, CA 90067-3100
NEW YORK, NY 10022-2000
NEW YORK, NY 10022
NEW YORK, NY 10022
NEW YORK, NY 10166
NEW YORK, NY 10166
25 MAIN STREET HACKENSACK

<COLGROUP><COL><COL></COLGROUP><THEAD>
</THEAD><TBODY>
[TD="align: center"]265[/TD]

[TD="align: center"]266[/TD]

[TD="align: center"]267[/TD]

[TD="align: center"]268[/TD]

[TD="align: center"]269[/TD]

[TD="align: center"]270[/TD]

[TD="align: center"]271[/TD]

[TD="align: center"]272[/TD]

[TD="align: center"]273[/TD]

</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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
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,224,592
Messages
6,179,790
Members
452,942
Latest member
VijayNewtoExcel

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