Separate data and put them into one line

I

iwins

I have 2 columns that have the records like
Column A Column B
Bert Dallas
Bert Texas
Bert Male
Mary Houston
Mary Texas
Mary Female
and I would like to combine them into one row
Column A Column B Column C Column D
Bert Dallas Texas Male
Mary Houston Texas Female

I've tried to do it using if statement, But I don't know have to make them
into one line. Is there any excel function that allow me to do it? If not,
what should i do? Please advise.

Thank you for the help!
 
T

Teethless mama

Make sure your columns have a header then
Go to Menu select Data>Filter>Auto Filter
 
T

Teethless mama

If you preferred automatic method then try this
Let's say you have your data in A2:B7

Bert in A10
Mary in A11
B10
=IF(ISERR(SMALL(IF($A$2:$A$7=$A10,ROW(INDIRECT("1:"&ROWS($B$2:$B$7)))),COLUMNS($A:A))),"",INDEX($B$2:$B$7,SMALL(IF($A$2:$A$7=$A10,ROW(INDIRECT("1:"&ROWS($B$2:$B$7)))),COLUMNS($A:A))))

It's an array formula. You have to commit ctrl>shift>enter (not just enter)
Copy across to the right and down
 
I

iwins

This works. Thank you.

Teethless mama said:
If you preferred automatic method then try this
Let's say you have your data in A2:B7

Bert in A10
Mary in A11
B10
=IF(ISERR(SMALL(IF($A$2:$A$7=$A10,ROW(INDIRECT("1:"&ROWS($B$2:$B$7)))),COLUMNS($A:A))),"",INDEX($B$2:$B$7,SMALL(IF($A$2:$A$7=$A10,ROW(INDIRECT("1:"&ROWS($B$2:$B$7)))),COLUMNS($A:A))))

It's an array formula. You have to commit ctrl>shift>enter (not just enter)
Copy across to the right and down
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top