+ Reply to Thread
Results 1 to 2 of 2

Excel 2007 : groupby and distinct

  1. #1
    Registered User
    Join Date
    06-07-2011
    Location
    PA, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    groupby and distinct

    Hi,

    I'm trying to find the count of unique/distinct transactions which contain the item key and have sum = 0 from the columns below.

    trans seq key item sum
    1213 1 29319280 106369 0
    1214 1 1899446 106369 0
    1220 1 125635869 106369 0
    1221 1 125635875 106369 0
    1221 2 125635875 202 2.25
    1224 1 79531558 106369 0
    1225 1 79531571 106369 0
    1225 2 79531571 82164 3.99
    1226 3 79531571 666666 2

    So in the above example i would get a count of 4. In sql, it would be a select distinct with groupby and a filter condition on item. Any idea on replication of this in excel?
    Last edited by kumarsubram; 06-07-2011 at 04:15 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: groupby and distinct

    Hi kumarsubram,

    Pivot Tables will allow you to group and count and filter on zero. See the attached to see if it does what you need.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

+ 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