ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   remove leading zeros from text strings (https://www.excelbanter.com/excel-worksheet-functions/37131-remove-leading-zeros-text-strings.html)

snooze

remove leading zeros from text strings
 
I have a long list of text strings and would like to remove leading zeros,
returning each string with zeros removed. Is there an easy way to do this
using excel text functions?

ie. 00234 234
02569 2569 etc


bpeltzer

If your string is in A1, then =trim(value(a1)) should get it. Value converts
it to a number and therefore drops leading 0's. Trim is my lazy way of
converting back to a string (the text function works also but requires
another argument).

"snooze" wrote:

I have a long list of text strings and would like to remove leading zeros,
returning each string with zeros removed. Is there an easy way to do this
using excel text functions?

ie. 00234 234
02569 2569 etc


Niek Otten

=TEXT(VALUE(C9),"#")

Or, if they don't have to remain strings, just

=VALUE(A1)

--
Kind regards,

Niek Otten

Microsoft MVP - Excel

"snooze" wrote in message
...
I have a long list of text strings and would like to remove leading zeros,
returning each string with zeros removed. Is there an easy way to do this
using excel text functions?

ie. 00234 234
02569 2569 etc





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

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