Code to move part of text from one cell to another?

keshamark98

New Member
Joined
Aug 4, 2014
Messages
3
So my issue right now is that I'm trying to copy and paste a part of a cell's text into another cell, but for thousands of cells. It's just the format the data came in when I was exporting it from another data software (it put both the X and Y values in the same cell). All of the numbers have the same number of digits per cell, so I should be able to drag this formula to all the adjacent cells and get what I want. Is there any such code that can do this?
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
You might be able to do this with an excel formula. Could you give an example of the original data and how you would like it split out?
 
Upvote 0
It's just the format the data came in when I was exporting it from another data software (it put both the X and Y values in the same cell). All of the numbers have the same number of digits per cell
We need more information about the values in the cells...

1) Is here a delimiter between the X and Y values (maybe a space, comma, dash, etc.)?

2) Do all the X values contain the same number of digits? If so, how many digits?

3) Do all the Y values contain the same number of digits? If so, how many digits?

4) Do the X and Y values contain the same number of digits each?
 
Upvote 0
Here is one of the cells:

3436.097656-482.148438

In this data cell, the number before the minus sign is the X value and the second number (including the negative sign) is the Y value, so it is just the two data points with nothing in between them (if both values are positive, it just looks like one number with two decimal points, example: 3436.000000226.148438). The other cells have variations in the length of the second number (the Y value), but the first number (the X value) remains the same number of digits for all of the cells.
 
Upvote 0
Here is one of the cells:

3436.097656-482.148438

In this data cell, the number before the minus sign is the X value and the second number (including the negative sign) is the Y value, so it is just the two data points with nothing in between them (if both values are positive, it just looks like one number with two decimal points, example: 3436.000000226.148438). The other cells have variations in the length of the second number (the Y value), but the first number (the X value) remains the same number of digits for all of the cells.
Maybe this then...

X number: =LEFT(A1,11)

Y number: =REPLACE(A1,1,11,"")
 
Upvote 0
Thanks so much Rick! That worked just the way I wanted to! :)
You are quite welcome. I notice, however, that I forgot to mention that those formulas return the numbers as text values and that if you wanted real numbers instead, then just add 0 to them...

X number: =0+LEFT(A1,11)

Y number: =0+REPLACE(A1,1,11,"")
 
Upvote 0

Forum statistics

Threads
1,215,688
Messages
6,126,209
Members
449,299
Latest member
KatieTrev

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