Splitting Column Cells into Two Columns

I am looking to split my cells from one column into two separate columns. I have data with an amount and a unit of measure (ex. 5kg). I am looking to separate that data into two columns, so it would be the amount in one column and the unit of measure in another tab (so 5 would be in one column and the column to the right would be kg). I have tried using the text to columns, but need more description on this. The data is inputted currently like "5kg" and there is no space between the 5 and the k, so that is where I am having difficulty. Thank you in advance!

|

Referring to the screen shot below

Formula in B2: =VALUE(LEFT(A2, MATCH(FALSE, ISNUMBER(MID(A2, ROW(INDIRECT("1:"&LEN(A2)+1)), 1) *1), 0) -1))

Formula in C2: =MID(A2,LEN(B2)+1,255)

Image

If desired, you can remove the formulas later by selecting the columns containing the formulas and Copy -> Paste Special >- Values to remove the formulas.

Also, if all data is a single unit type and you are wanting to use the values but still display the kg with the value after using the formulas in column B, you can use Custom Number Format.

The Custom number format is as follows.

0"kg" (That is zero, double quote, kg and double quote again.

Image

Regards,

OssieMac

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi Kailyn. I am an Excel user like you.

Excel will automate this with Flash Fill.

Enter the breakdown you want for the first row of the data as below..

Image

Then highlight the range that you want to fill in. In the screenshot this would be B2:B5. Then click on Flash Fill on the Data ribbon in the Data Tools section.

Image

Excel will fill in the corresponding data.

Image

Then repeat for the next column highlighting the range (C2:C5 this time) and click Flash Fill.

Image

Reply if you have additional questions or information. Please mark this reply as answered if this solves your question.

Rich~M

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

@Rich-M

Absolutely magic. My original reason for joining the forum was to pick up on stuff that I didn't know about.

@Kailyn Kilroe

You might be interested in the following couple of Microsoft links with further information on FlashFill.

Enable Flash Fill in Excel - Microsoft Support

Using Flash Fill in Excel - Microsoft Support

Regards,

OssieMac

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

If you have seperators in your string, it may cause issues with your excellent solution.

(the formula in B7, and another formula in C7)

I would use a simplier worksheet function like in E2?

Image

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Hi,

In cell C2, enter this formula

=TEXTSPLIT(A2,VSTACK(".",SEQUENCE(10,,0)),,TRUE)

In cell B2, enter this formula

=1*(LEFT(A2:A4,SEARCH(C2:C4,A2:A4)-1))

Hope this helps.

Regards,

Ashish Mathur
www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated May 6, 2024 Views 76 Applies to: