ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Pulling partial information from a cell (https://www.excelbanter.com/excel-worksheet-functions/202936-pulling-partial-information-cell.html)

Emeryville John

Pulling partial information from a cell
 
Hi,

Thanks to Dave and Peo for help on my previous request.

I have a list of 5 digit zip codes (eg. 90210) and a list of 5 + 4 digit zip
codes (eg. 90210-1234). How can I pull just the first 5 digits from the 5 +
4 digit zip codes?

Teethless mama

Pulling partial information from a cell
 
=LEFT(A1,5)

"Emeryville John" wrote:

Hi,

Thanks to Dave and Peo for help on my previous request.

I have a list of 5 digit zip codes (eg. 90210) and a list of 5 + 4 digit zip
codes (eg. 90210-1234). How can I pull just the first 5 digits from the 5 +
4 digit zip codes?


Ron Coderre[_3_]

Pulling partial information from a cell
 
With
A1 containing a numeric zip code, formatted as either a 5-digit zip code OR
a 5+4 zip code

This formula returns the 5 digit part:
B1: =LEFT(TEXT(A1,"00000"&IF(A1=10000,"-0000","")),5)

Is that something you can work with?

Regards,

Ron Coderre
Microsoft MVP (Excel)

"Emeryville John" wrote in
message ...
Hi,

Thanks to Dave and Peo for help on my previous request.

I have a list of 5 digit zip codes (eg. 90210) and a list of 5 + 4 digit
zip
codes (eg. 90210-1234). How can I pull just the first 5 digits from the 5
+
4 digit zip codes?




All times are GMT +1. The time now is 10:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com