Converting Multiline Cell values to Single cell values

M_S_K

New Member
Joined
Apr 30, 2021
Messages
1
Office Version
  1. 2016
Platform
  1. Windows
Hi All,

I would like to know how to handle the multiline cell values in Excel.

I have a source excel file in the below format.

KeyCountry/State
A0001Australia
Sydney
Perth
A0002India
Tamilnadu
Andhra

I need the output to be in below format.

KeyCountryState
A0001AustraliaSydney
A0001AustraliaPerth
A0002IndiaTamilnadu
A0002IndiaAndhra

Most of the online articles suggest to use "Text to Columns" with "\n" character as the delimited to break the multi-line cell to single cell. Seems this option won't work for me as the data will be pasted in column wise after the "Text to Columns" operation. Is there any other better way to get the desired output? Your responses are highly appreciated.

Thank You.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Hi,​
as you forgot to indicate where should be the 'output'❓
 
Upvote 0
Another question : is the value 'A0001' for example is some merged cells like when copying your initial 'attachment' to a worksheet ?​
If not - within a single cell - so it's better to link your sample workbook on a files host website …​
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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