+ Reply to Thread
Results 1 to 4 of 4

Distinct count of one column based on another column

  1. #1
    Registered User
    Join Date
    07-16-2014
    Location
    OKlahoma
    MS-Off Ver
    2013 64 bit
    Posts
    90

    Distinct count of one column based on another column

    Ok so this is kinda hard to explain but let me try. I have a set of records over 1million long. This is a log sheet of sales. So Col A is Cust ID and Col B is sales date. I need to be able to find out how many months throughout the year each cust ID bought something. So for a small example I have included an attachment that also shows my desired results. Sample data.xlsx

    I basically need to find a way to get sumif of the distinct months but I am having a brain fart on how to do that.

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Distinct count of one column based on another column

    Hi,

    If you insert a helper column (use column C), and insert the following formula in C2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Then fill the formula down to the end of your data. Then use this array formula to count the months:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    A working example of this formula can be seen in the attachment on the AJRYAN88 worksheet.

    NB: This is an array formula, and needs to be entered using Ctrl + Shift + Enter, rather than just Enter.

    I hope this helps
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    07-16-2014
    Location
    OKlahoma
    MS-Off Ver
    2013 64 bit
    Posts
    90

    Re: Distinct count of one column based on another column

    Thanks for the help this appears to work. next question since i am new to Array Formulas can I just copy the formula down the Col like I do any other formula or is there something special for that part as well.

  4. #4
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Distinct count of one column based on another column

    It depends on how the formula is written. However, I wrote this one so that it can indeed be filled down as far as is required

    Please don't forget to mark this thread as solved (Thread Tools --> Mark As Solved), and please click on the * next to my post 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)

Similar Threads

  1. Replies: 7
    Last Post: 01-29-2015, 10:14 AM
  2. [SOLVED] How to count distinct values in a column
    By marchandoj in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 01-21-2014, 12:23 PM
  3. [SOLVED] Count the number of items sold in one column based on the quantity in another column
    By mike_m1 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-20-2013, 05:48 AM
  4. Replies: 10
    Last Post: 07-16-2013, 03:19 PM
  5. Replies: 9
    Last Post: 06-08-2012, 06:22 PM

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