+ Reply to Thread
Results 1 to 2 of 2

Thread: Sorting rows by number of same IDs

  1. #1
    Registered User
    Join Date
    05-10-2010
    Location
    Edinburgh, Scotland
    MS-Off Ver
    Excel 2003
    Posts
    1

    Sorting rows by number of same IDs

    This may be difficult to describe, but I am trying to sort a large excel spreadsheet which details customer data.

    The problem is that I want to copy a formula for all customers, but some have 1, 2 or 3 rows of data to be included in a simple formula. If I can arrange those customers that have 1 row of data and then secondly those with 2 rows I can set a formula to drag down for just the customers with 1 row and then those with 2 etc.

    So, I want to sort my data that looks like:

    Name Days
    1 Smith 5
    2 Smith 2
    3 Bloggs 1
    4 Brown 6
    5 Brown 5
    6 Brown 2
    7 Green 8

    So that it looks like this:

    Name Days Formula (sum)
    1 Bloggs 1 1
    2 Green 8 8
    3 Smith 5
    4 Smith 2 7
    5 Brown 6
    6 Brown 5
    7 Brown 2 13

    I hope someone can suggest something.
    Thanks
    Alec

  2. #2
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Boston
    MS-Off Ver
    Excel 2007
    Posts
    174

    Re: Sorting rows by number of same IDs

    You will need 2 new columns -

    The first being a CountIf() formula -

    Countif(B:B, B2)

    Copy that formula down then sort by the column.

    The next is Sumif()

    =IF(B3<>B2,SUMIF(B:B,B2,C:C),"")

+ 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.2.0