Help with converting text and numbers

Lesjoan01

New Member
Joined
Mar 29, 2017
Messages
23
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have quite a few large spreadsheets that contain unique reference numbers (both text and numbers) that I need to convert to a new format.

Examples of current text number formats:

ABC.1-235
LD.12-1
XYZ.356-12

Examples of what need converting to:

ABC00001.235
LD00012.1
XYZ00356.12

If have used the Replace formula, but I must be doing something wrong as I am having to manually change areas within the formula when I drag it down through the spreadsheet.

Is Replace the correct formula to use?

Can anyone help or suggest a better way to do this? Some of the spreadsheets have over 6,000 entries on them - so really need a formula that I can apply.

Many thanks

Lesley :)
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
it could be done with formula and helper cells but if only needed once i would use find and replace

select entire column and press CTRL + H keys to open find/replace dialogue box in find put "." just the fullstop and in the replace box put nothing and click replace all

then in the find box put "-" just the dash and in replace box put "." just the fullstop

based on your examples this should produce the required results
 
Upvote 0
Hi there,
do you want to replace all the dots by 4 zero and all the dash by a dot?

if yes maybe use the function text to column, define the sepration with the dot then the dash.
once done use the concatenate formula to add what you want.

or is it a changing number of zero? in this that's a little more complicated.

Regards
 
Upvote 0
Hi there,
do you want to replace all the dots by 4 zero and all the dash by a dot?

if yes maybe use the function text to column, define the sepration with the dot then the dash.
once done use the concatenate formula to add what you want.

or is it a changing number of zero? in this that's a little more complicated.

Regards


i missed the 000 the 3 zero's so my solution would need to be changed on part one replace "." with "000"
 
Upvote 0
so really need a formula that I can apply.

Hi, welcome to the forum! It's a bit long, but here is one formula that you can try:


Excel 2013
AB
2ABC.1-235ABC00001.235
3LD.12-1LD00012.1
4XYZ.356-12XYZ00356.12
Sheet1
Cell Formulas
RangeFormula
B2=LEFT(A2,FIND(".",A2)-1)&TEXT(LEFT(SUBSTITUTE(MID(A2,FIND(".",A2)+1,10),"-",REPT(" ",10)),10),"00000")&"."&MID(A2,FIND("-",A2)+1,10)
 
Upvote 0
Hi AkaTrouble,

thanks for replying. This needs to be done more than once that why a formula would be the preferred route to go down.

Kind Regards

Lesley
 
Upvote 0
Hi FormR,

you star - that has worked perfectly - cannot thank you enough :).

If I need anymore assistance with this would you mind if I came back to you?

Really appreciate your help

Kind regards

Lesley
 
Upvote 0
Hi sastoka,

thanks for your response. FormR has managed to provide me with a solution, but thank you for taking the time to reply.

Kind regards

Lesley
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top