Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-29-2008, 05:48 PM
skiing
 
Posts: n/a
remove leading zeros on a text field

I have an item number field which I use a formula to pull the last
segment of the item number field
( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )

the results would be a text field such as 00000094 or 0001A-A
or 0230-B

I need to find a way to remove the leading 0's

does anyone have any ideas?

thank you for your time and assistance
Reply With Quote
  #2 (permalink)  
Old 04-29-2008, 06:00 PM
Niek Otten
 
Posts: n/a
Re: remove leading zeros on a text field

=VALUE(A1) or, if you want to keep it text, =TEXT(VALUE(A1),"#")

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"skiing" <trpayne@chatt.com> wrote in message news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
|I have an item number field which I use a formula to pull the last
| segment of the item number field
| ( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )
|
| the results would be a text field such as 00000094 or 0001A-A
| or 0230-B
|
| I need to find a way to remove the leading 0's
|
| does anyone have any ideas?
|
| thank you for your time and assistance


Reply With Quote
  #3 (permalink)  
Old 04-29-2008, 06:09 PM
Bernie Deitrick
 
Posts: n/a
Re: remove leading zeros on a text field

t.r.,

What is the definition of "last segment"? I would think that WBN-2-IVSG-043-0001A-A's last segment
would be "A"...

Anyway, if the formula that you use to extract the last segment is in cell B2 (based on whatever
rules you actually require), then array enter this formula (enter using Ctrl-Shift-Enter) to remove
the leading zeroes:

=MID(B2,MAX((LEFT(B2,ROW(INDIRECT("1:" & LEN(B2))))=REPT("0",ROW(INDIRECT("1:" &
LEN(B2)))))*ROW(INDIRECT("1:" & LEN(B2))))+1,LEN(B2))

HTH,
Bernie
MS Excel MVP


"skiing" <trpayne@chatt.com> wrote in message
news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
>I have an item number field which I use a formula to pull the last
> segment of the item number field
> ( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )
>
> the results would be a text field such as 00000094 or 0001A-A
> or 0230-B
>
> I need to find a way to remove the leading 0's
>
> does anyone have any ideas?
>
> thank you for your time and assistance



Reply With Quote
  #4 (permalink)  
Old 04-29-2008, 06:09 PM
Bernie Deitrick
 
Posts: n/a
Re: remove leading zeros on a text field

Niek,

That won't work with the trailing letters...

Bernie
MS Excel MVP


"Niek Otten" <nicolaus@xs4all.nl> wrote in message news:ufGOzphqIHA.4788@TK2MSFTNGP03.phx.gbl...
> =VALUE(A1) or, if you want to keep it text, =TEXT(VALUE(A1),"#")
>
> --
> Kind regards,
>
> Niek Otten
> Microsoft MVP - Excel
>
> "skiing" <trpayne@chatt.com> wrote in message
> news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
> |I have an item number field which I use a formula to pull the last
> | segment of the item number field
> | ( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )
> |
> | the results would be a text field such as 00000094 or 0001A-A
> | or 0230-B
> |
> | I need to find a way to remove the leading 0's
> |
> | does anyone have any ideas?
> |
> | thank you for your time and assistance
>
>



Reply With Quote
  #5 (permalink)  
Old 04-29-2008, 06:11 PM
skiing
 
Posts: n/a
Re: remove leading zeros on a text field

I tried the Value function and it worked great on the 00000094 like
items -- but on the 0001A-A items the results were #VALUE! --

when I tried the =TEXT(VALUE(A1),"#") it bombed as well due to the
Value(A1) bombing

any other suggestions?

THANKS !

On Apr 29, 1:00*pm, "Niek Otten" <nicol...@xs4all.nl> wrote:
> =VALUE(A1) or, if you want to keep it text, =TEXT(VALUE(A1),"#")
>
> --
> Kind regards,
>
> Niek Otten
> Microsoft MVP - Excel
>
> "skiing" <trpa...@chatt.com> wrote in messagenews:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
>
> |I have an item number field which I use a formula to pull the last
> | segment of the item number field
> | ( such as: *WBN-2-FCCG-043-00000094 or *WBN-2-IVSG-043-0001A-A )
> |
> | the results would be a text field such as * 00000094 * or * *0001A-A
> | or * *0230-B
> |
> | I need to find a way to remove the leading 0's
> |
> | does anyone have any ideas?
> |
> | thank you for your time and assistance


Reply With Quote
  #6 (permalink)  
Old 04-29-2008, 06:12 PM
Niek Otten
 
Posts: n/a
Re: remove leading zeros on a text field

Thanks, Bernie,

You're right! I just looked at the first example.........

--
Kind regards,

Niek Otten
Microsoft MVP - Excel

"Bernie Deitrick" <deitbe @ consumer dot org> wrote in message news:eNxkJvhqIHA.2292@TK2MSFTNGP03.phx.gbl...
| Niek,
|
| That won't work with the trailing letters...
|
| Bernie
| MS Excel MVP
|
|
| "Niek Otten" <nicolaus@xs4all.nl> wrote in message news:ufGOzphqIHA.4788@TK2MSFTNGP03.phx.gbl...
| > =VALUE(A1) or, if you want to keep it text, =TEXT(VALUE(A1),"#")
| >
| > --
| > Kind regards,
| >
| > Niek Otten
| > Microsoft MVP - Excel
| >
| > "skiing" <trpayne@chatt.com> wrote in message
| > news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
| > |I have an item number field which I use a formula to pull the last
| > | segment of the item number field
| > | ( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )
| > |
| > | the results would be a text field such as 00000094 or 0001A-A
| > | or 0230-B
| > |
| > | I need to find a way to remove the leading 0's
| > |
| > | does anyone have any ideas?
| > |
| > | thank you for your time and assistance
| >
| >
|
|


Reply With Quote
  #7 (permalink)  
Old 04-29-2008, 07:53 PM
skiing
 
Posts: n/a
Re: remove leading zeros on a text field

Bernie

I do not know how to array enter this formula - I copied and pasted it
and used it in a cell - it did remove the leading 0 on the cell
defined but how do I repeatedly do this?

thank you again - so much !


On Apr 29, 1:09*pm, "Bernie Deitrick" <deitbe @ consumer dot org>
wrote:
> t.r.,
>
> What is the definition of "last segment"? *I would think that WBN-2-IVSG-043-0001A-A's last segment
> would be "A"...
>
> Anyway, if the formula that you use to extract the last segment is in cellB2 (based on whatever
> rules you actually require), then array enter this formula (enter using Ctrl-Shift-Enter) to remove
> the leading zeroes:
>
> =MID(B2,MAX((LEFT(B2,ROW(INDIRECT("1:" & LEN(B2))))=REPT("0",ROW(INDIRECT("1:" &
> LEN(B2)))))*ROW(INDIRECT("1:" & LEN(B2))))+1,LEN(B2))
>
> HTH,
> Bernie
> MS Excel MVP
>
> "skiing" <trpa...@chatt.com> wrote in message
>
> news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
>
>
>
> >I have an item number field which I use a formula to pull the last
> > segment of the item number field
> > ( such as: *WBN-2-FCCG-043-00000094 or *WBN-2-IVSG-043-0001A-A )

>
> > the results would be a text field such as * 00000094 * or * *0001A-A
> > or * *0230-B

>
> > I need to find a way to remove the leading 0's

>
> > does anyone have any ideas?

>
> > thank you for your time and assistance- Hide quoted text -

>
> - Show quoted text -


Reply With Quote
  #8 (permalink)  
Old 04-29-2008, 07:55 PM
Rick Rothstein \(MVP - VB\)
 
Posts: n/a
Re: remove leading zeros on a text field

Is there **always** digit after the last leading zero (that is, never
something like 000ABC)? If so...

=MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9},A1&"123456789 ")),99)

Rick



"skiing" <trpayne@chatt.com> wrote in message
news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
>I have an item number field which I use a formula to pull the last
> segment of the item number field
> ( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )
>
> the results would be a text field such as 00000094 or 0001A-A
> or 0230-B
>
> I need to find a way to remove the leading 0's
>
> does anyone have any ideas?
>
> thank you for your time and assistance


Reply With Quote
  #9 (permalink)  
Old 04-29-2008, 08:05 PM
Rick Rothstein \(MVP - VB\)
 
Posts: n/a
Re: remove leading zeros on a text field

If you can have the situation where only non-digits follow the leading
zeroes, then this formula should work for this general case...

=IF(MIN(FIND({1,2,3,4,5,6,7,8,9},A1&"123456789"))< =LEN(A1),MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9},A1&"1 23456789")),99),SUBSTITUTE(A1,"0",""))

Rick


"Rick Rothstein (MVP - VB)" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in
message news:uMOoKqiqIHA.4912@TK2MSFTNGP03.phx.gbl...
> Is there **always** digit after the last leading zero (that is, never
> something like 000ABC)? If so...
>
> =MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9},A1&"123456789 ")),99)
>
> Rick
>
>
>
> "skiing" <trpayne@chatt.com> wrote in message
> news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
>>I have an item number field which I use a formula to pull the last
>> segment of the item number field
>> ( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )
>>
>> the results would be a text field such as 00000094 or 0001A-A
>> or 0230-B
>>
>> I need to find a way to remove the leading 0's
>>
>> does anyone have any ideas?
>>
>> thank you for your time and assistance

>


Reply With Quote
  #10 (permalink)  
Old 04-29-2008, 08:28 PM
Rick Rothstein \(MVP - VB\)
 
Posts: n/a
Re: remove leading zeros on a text field

Forget this general solution (but if you don't have this situation, still
use my first posted formula)... it won't work if one or more zeroes can
follow the first non-digit.

Rick


"Rick Rothstein (MVP - VB)" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in
message news:ucj5IwiqIHA.4912@TK2MSFTNGP03.phx.gbl...
> If you can have the situation where only non-digits follow the leading
> zeroes, then this formula should work for this general case...
>
> =IF(MIN(FIND({1,2,3,4,5,6,7,8,9},A1&"123456789"))< =LEN(A1),MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9},A1&"1 23456789")),99),SUBSTITUTE(A1,"0",""))
>
> Rick
>
>
> "Rick Rothstein (MVP - VB)" <rick.newsNO.SPAM@NO.SPAMverizon.net> wrote in
> message news:uMOoKqiqIHA.4912@TK2MSFTNGP03.phx.gbl...
>> Is there **always** digit after the last leading zero (that is, never
>> something like 000ABC)? If so...
>>
>> =MID(A1,MIN(FIND({1,2,3,4,5,6,7,8,9},A1&"123456789 ")),99)
>>
>> Rick
>>
>>
>>
>> "skiing" <trpayne@chatt.com> wrote in message
>> news:96ffde7d-1fda-47e1-9b44-d3f1e154d799@w7g2000hsa.googlegroups.com...
>>>I have an item number field which I use a formula to pull the last
>>> segment of the item number field
>>> ( such as: WBN-2-FCCG-043-00000094 or WBN-2-IVSG-043-0001A-A )
>>>
>>> the results would be a text field such as 00000094 or 0001A-A
>>> or 0230-B
>>>
>>> I need to find a way to remove the leading 0's
>>>
>>> does anyone have any ideas?
>>>
>>> thank you for your time and assistance

>>

>


Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:55 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Loan | Credit Cards | Online Loans | Mobile Phones | Personal Loans



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114