Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default changing text values to a different string

We have cells that are text and 1 2 3 .....110

the problem is now they want them as
001
002
099
100


can can the 1 2 3 98 99 be converted to leading 0's automatically

this wouldn't be too bad but it also has visit no's

so I have

ID VISIT
1_____1
1_____2
1_____3
1_____4
2_____1
..
..
..
99_____3
99_____4

ect


this is becoming a nightmare to me

thanks for any help

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
bj bj is offline
external usenet poster
 
Posts: 1,397
Default changing text values to a different string

custom format of cells can have numbers with leading zeros
formatcellsnumbercustom000
change the text to numbers
by
=value(text)

If however you want them to remain text as I think you want to from the
second half of your statement
if the length of the _____1 portion is always the same (8?) so that you want
11 characters

try
=rept("0",11-len(text_cell))&text_cell

"sparks" wrote:

We have cells that are text and 1 2 3 .....110

the problem is now they want them as
001
002
099
100


can can the 1 2 3 98 99 be converted to leading 0's automatically

this wouldn't be too bad but it also has visit no's

so I have

ID VISIT
1_____1
1_____2
1_____3
1_____4
2_____1
..
..
..
99_____3
99_____4

ect


this is becoming a nightmare to me

thanks for any help


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default changing text values to a different string

Is the underscore symbol part of the entry for that column, or have
you just put those in to make your posting clearer? If they are
included, then this formula will give you what you want:

=TEXT(LEFT(A1,FIND("_",A1)-1),"000")&MID(A1,FIND("_",A1),255)

assuming your values are in cell A1. Put this in B1 and copy down the
column by double-clicking the fill handle (the small black square in
the bottom right corner of the cursor).

You can then hide column A, or you could fix the values in column B
and then delete column A.

Hope this helps.

Pete


On Jul 16, 2:56 pm, sparks wrote:
We have cells that are text and 1 2 3 .....110

the problem is now they want them as
001
002
099
100

can can the 1 2 3 98 99 be converted to leading 0's automatically

this wouldn't be too bad but it also has visit no's

so I have

ID VISIT
1_____1
1_____2
1_____3
1_____4
2_____1
.
.
.
99_____3
99_____4

ect

this is becoming a nightmare to me

thanks for any help



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default changing text values to a different string

Thanks big time to everyone for the help
this works fine


thanks again

Sparks


On Mon, 16 Jul 2007 08:02:08 -0700, Pete_UK
wrote:

Is the underscore symbol part of the entry for that column, or have
you just put those in to make your posting clearer? If they are
included, then this formula will give you what you want:

=TEXT(LEFT(A1,FIND("_",A1)-1),"000")&MID(A1,FIND("_",A1),255)

assuming your values are in cell A1. Put this in B1 and copy down the
column by double-clicking the fill handle (the small black square in
the bottom right corner of the cursor).

You can then hide column A, or you could fix the values in column B
and then delete column A.

Hope this helps.

Pete


On Jul 16, 2:56 pm, sparks wrote:
We have cells that are text and 1 2 3 .....110

the problem is now they want them as
001
002
099
100

can can the 1 2 3 98 99 be converted to leading 0's automatically

this wouldn't be too bad but it also has visit no's

so I have

ID VISIT
1_____1
1_____2
1_____3
1_____4
2_____1
.
.
.
99_____3
99_____4

ect

this is becoming a nightmare to me

thanks for any help



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default changing text values to a different string

You're welcome - thanks for feeding back.

Pete

On Jul 16, 5:40 pm, sparks wrote:
Thanks big time to everyone for the help
this works fine

thanks again

Sparks

On Mon, 16 Jul 2007 08:02:08 -0700, Pete_UK
wrote:



Is the underscore symbol part of the entry for that column, or have
you just put those in to make your posting clearer? If they are
included, then this formula will give you what you want:


=TEXT(LEFT(A1,FIND("_",A1)-1),"000")&MID(A1,FIND("_",A1),255)


assuming your values are in cell A1. Put this in B1 and copy down the
column by double-clicking the fill handle (the small black square in
the bottom right corner of the cursor).


You can then hide column A, or you could fix the values in column B
and then delete column A.


Hope this helps.


Pete


On Jul 16, 2:56 pm, sparks wrote:
We have cells that are text and 1 2 3 .....110


the problem is now they want them as
001
002
099
100


can can the 1 2 3 98 99 be converted to leading 0's automatically


this wouldn't be too bad but it also has visit no's


so I have


ID VISIT
1_____1
1_____2
1_____3
1_____4
2_____1
.
.
.
99_____3
99_____4


ect


this is becoming a nightmare to me


thanks for any help- Hide quoted text -


- Show quoted text -



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
changing numbers in a text string in a new cell Xhawk57 Excel Discussion (Misc queries) 4 May 16th 07 06:22 PM
Sum delimited values in text string if... J Excel Worksheet Functions 7 February 24th 07 06:10 PM
How do I use IF in Excel to string the two text values (high,low) frankofile Excel Worksheet Functions 5 December 1st 05 03:18 AM
Extrapolate numeric values from text string Henrik Excel Worksheet Functions 4 November 3rd 05 06:25 PM
Changing a specific character type in text string olasa Excel Discussion (Misc queries) 0 March 20th 05 11:35 PM


All times are GMT +1. The time now is 01:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"