+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : Excel Data Sorting Question

  1. #1
    Registered User
    Join Date
    05-19-2011
    Location
    Washington, DC
    MS-Off Ver
    Excel 2007
    Posts
    1

    Excel Data Sorting Question

    Sorry if this has already been addressed, but I have a question about how to easily sort data in excel.

    I have a long list of zip codes and I am trying to attach data points to them so they appear in the same row, unfortunately, there are more than one data point corresponding with each zip code.

    Essentially, what my data looks like is:

    20005 | data point A
    20005 | data point B
    20006 | data point A
    20006 | data point B
    20006 | data point C

    And so on.

    What I need it to look like is:

    20005 | data point A | data point B
    20006 | data point A | data point B | data point C

    So that for each zip code, all the related data points are in the same row. I tried this with a pivot table, but it merely put things in outline form and wouldn't let me update the display.

    Does anyone know an easy way to reorganize the data like this?

    Thanks!

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,178

    Re: Excel Data Sorting Question

    You don't seem to have had a response yet.

    Assuming that you have headings in row 1, the zip codes are in column A, the data points are in column B, and there is no data in column C and beyond, try this in cell C2:

    =IF($A2=$A1,"",IF(COLUMN(C1)-COLUMN($B1)>COUNTIF($A:$A,$A2),"",INDEX($B:$B,MATCH($A2,$A:$A,0)+COLUMN(C1)-COLUMN($B1)-1)))

    Drag across and down.


    You can copy and paste special | values to convert the formulae to text. You could then filter to remove duplicate rows.

    The number of assumptions and the lack of a sample workbook may be the reason you have had no replies.


    For an automated solution, have a look at the attached workbook.

    The code is:

    Please Login or Register  to view this content.

    The earlier version, CollateDataPoints, does the same thing but has a fixed number of columns.

    I hope this helps

    Regards
    Attached Files Attached Files
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1