Question

I have a field called Image Size that has values like:

12x12
20x8
20x8
20x8
20x8
10x8
10x8
36x12
27x27
39.75x20

How would I go about putting the length in one column and the width in another column?

Was it helpful?

Solution

There are two functions you can use to split text in Excel for this purpose: LEFT and RIGHT. These functions take the text to split and the number of characters to take from one side. For instance, LEFT("asdf", 2) would take 2 characters from the string "asdf", starting from the left side.

You can combine these functions with the SEARCH function to find the "x" in the middle, so in each row, you would put the image in column 1,

=LEFT(A1, SEARCH("x",A1,1))

in column 2, and

=RIGHT(A1,LEN(A1)-SEARCH("x",A1,1))

in column 3. (These examples are for row A.)

Reference: http://office.microsoft.com/en-us/excel-help/split-text-among-columns-by-using-functions-HA010102341.aspx

EDIT: As pointed out in a comment by the OP, the first formula should be

=LEFT(A1, SEARCH("x",A1,1) - 1)

so that the "x" isn't included

OTHER TIPS

With data in A1 , use:

=--LEFT(A1,FIND("X",A1)-1)

and

=--MID(A1,FIND("X",A1)+1,9999)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top