+ Reply to Thread
Results 1 to 7 of 7

Create New Count List Excluding Duplicates

  1. #1
    Registered User
    Join Date
    06-03-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    4

    Create New Count List Excluding Duplicates

    Hi Guys,

    I've been reading up on this site for a while, but this is my first post.

    The issue I have is that I have a list of incidents occuring on various applications, and I need to create a new list from the original, that counts the number of incidents for each application, but having just one row (in the new list) for each application.

    The difficulty I'm having is that I have a list of all possible applications, but not all of these applications have had incidents as of yet, so if I looked up from there, then there will be lots of zero values in the new table. I imagine the best way to solve this would be to lookup from there and not have the zero values populated in the list, but I've struggled massively to do this.

    I've attached a sample of my data, hopefully it'll help. If I haven't been clear, please let me know and I'll try and clarify more. :-)

    Thanks in advance,

    Chris
    Attached Files Attached Files

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Create New Count List Excluding Duplicates

    How are you counting the "Number of Incidents"?
    I can't reconcile the expected result with the data table.

  3. #3
    Registered User
    Join Date
    06-03-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    4

    Re: Create New Count List Excluding Duplicates

    Thanks for the reply.

    Apologies, I just randomly typed those numbers to try and explain the type of format I'm after.

    I've counted them properly now and attached the new version.

    Chris
    Attached Files Attached Files

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,592

    Re: Create New Count List Excluding Duplicates

    Do you mean this in A2:

    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",INDEX(Sample!$A$2:$A$1000,MATCH(TRUE,INDEX(ISNA(MATCH(Sample!$A$2:$A$1000,$A$1:$A1,0)),0),0))))

    but I don't see point of putting 1 in each row by default. You don't need formula for that. You can just put 1.

  5. #5
    Registered User
    Join Date
    06-03-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2003 / 2007
    Posts
    4

    Re: Create New Count List Excluding Duplicates

    Sorry, I must have uploaded the file before I made my final save. The Countif formula should have the reference to the Sample sheet so the numbers go in there automatically. I've uploaded the proper version again.

    Thank you so much, the formula you've given me is exactly what I was trying to do, however when I put this into the actual document I don't get the same result. Unfortunately I can't post the original spreadsheet because it contains sensitive data.

    I've changed the formula you gave slightly to try and adapt it for the original spreadsheet:
    from
    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",INDEX(Sample!$A$2:$A$1000,MATCH(TRUE,INDEX(ISNA(MATCH(Sample!$A$2:$A$1000,$A$1:$A1,0)),0),0))))
    to
    =LOOKUP(REPT("Z",255),CHOOSE({1,2},"",INDEX('P2 Incident Summary'!$A$5:$A$1000,MATCH(TRUE,INDEX(ISNA(MATCH('P2 Incident Summary'!$A$5:$A$1000,$A$5:$A5,0)),0),0))))

    because 'P2 Incident Summary' is the equivalent sheet to 'Sample', and the data starts in cell A5 rather than A2. The only other difference that I can think of is that where I have given a letter for the app. name in the sample, that letter is the first letter of the full application name.

    I don't suppose you could tell where I'm going wrong from that?

    Thank you very much,

    Chris
    Attached Files Attached Files

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Create New Count List Excluding Duplicates

    Maybe best you use a dynamic named range "Apps" ...
    Refers to:=
    Please Login or Register  to view this content.
    This is more economic than using a static range big enough to cover all possibilities, in as much that it calculates exactly the range required.

    Then in Sheet "Example ... " A2
    Please Login or Register  to view this content.
    And in B2
    Please Login or Register  to view this content.
    Drag both down until blanks are returned then a bit more to allow for a growing Sheet"Sample"
    Then if you add or delete rows before your header row in Sheet"Sample" the formulae will still work.
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Create New Count List Excluding Duplicates

    select new sheet
    data/filter/advanced
    select copy to another location and unique values only
    click in list range field
    click tab of your data (in this case the tab "sample"
    select col a
    click in the copy to field
    it will jump to your new sheet
    click a1
    click ok
    you now have an unique list
    so in b2 put
    =COUNTIF(Sample!A:A,A2)
    drag down
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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