Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Leading zeros plus text

Status
Not open for further replies.

lenebene

Programmer
Sep 24, 2002
15
US
I am having a problem adding leading zeros to an account. Example:

RTF-123
Should look like this - RTF-00123

RRR-12
Should look like this - RRR-00012

Any help would be greatly appreciated.

Thanks!
 


Hi,

I assume that you are CONCATENATING a number with text
[tt]
=YourText&Text(YourNumber,"00000")
[/tt]


Skip,
[sub]
[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue][/sub]
 
I presume Excel is what you are looking for

If your account number is in cell A2, then

=LEFT(A2,FIND("-",A2))&"000"&RIGHT(A2,LEN(A2)-FIND("-",A2))



 
Sorry. Yes it was excel!

Thank you xlhelp. I was able to get yours to work... I must be brainless today because I couldn't get Skips to work.. :)

Thanks again!
 


xlbo's works of you already have the string put together.

Mine works putting the string together from scratch.

Skip,
[sub]
[glasses] [red]Be Advised![/red] A chicken, who would drag a wagon across the road for 2 cents, is…
POULTRY in motion to PULLET for a PALTRY amount! [tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top