View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Roger Govier[_8_] Roger Govier[_8_] is offline
external usenet poster
 
Posts: 376
Default How to combine rows?

Hi Dina

Insert a new column at C and title it Company2
Title column E City2
Title column F Duplicate

Sort your data ascending by column A
In C2 enter
=IF($A3=$A2,B3,"")
in E2 enter
=IF($A3=$A2,D3,"")
in F2 enter
=IF($A2=$A1,"Dup","")
Copy the formulae down for the extent of your data

Copy in turn each of columns C, E and F Paste Specialvalues

Now sort your whole block of data by Column F ascending.
all your Duplicate rows will be at the end of the list and can be deleted.
--
Regards
Roger Govier

Dina wrote:
How can I do this?

Name| Company | City
Jon Smith| IBM| Toronto
Jon Smith| TD| montreal

into this:

Name| Company | Company2 | City | City 2
Jon Smith| IBM | TD | Toronto | Montreal

Thank you!!