+ Reply to Thread
Results 1 to 12 of 12

Unique Values by month in date range

Hybrid View

  1. #1
    Registered User
    Join Date
    09-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    5

    Unique Values by month in date range

    Hi All,
    First thank to all who contribute, I've found this forum to be immensely helpful. I've searched through the forums but haven't quite found a solution to my issue. I have a set of values in Col A which have a related date in Col B. What I would like to do is count unique values in A where date is in year 2013 (or other variations such as between 1/1/2013-3/31/2013). Secondly, I would like to be able to visualize by month the unique counts of A. For instance, Unique Names down vertical and Months for each year along the vertical access. Could be table, chart, pivot.

    I'm attaching a sample sheet if the above doesn't quite make sense.unique values by month.xlsx

    Many thanks!
    Kerry

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Unique Values by month in date range

    In E7, plop:

    =IFERROR(INDEX($A$4:$A$56,MATCH(0,COUNTIF($E$6:E6, $A$4:$A$56),0)),"")

    Which is an array formula confirmed with Ctrl+Shift+Enter instead of just hitting Enter as normal to exit the cell. Drag this down as far as needed, it will create your list.

    In F7, plop:

    =SUMPRODUCT(($B$4:$B$56>=F$6)*($B$4:$B$56<EOMONTH(F$6,0))*($A$4:$A$56=$E7))

    And copy as far over and down as needed. This will count each unique value per month in the range.

  3. #3
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Unique Values by month in date range

    As for PivotTable, which I am practically clueless about:

    Highlight the data A3:B56, click Insert -> Pivot Table

    Pull Name down to RowLabel, pull Created Date down to Column Labels, and then pull down down Created Date again to Values

    Now in the pivot table, right click on the first date in the column headers. Choose "Group..." and select both Month and Year. Hit Okay.

    This is the much faster version.

  4. #4
    Registered User
    Join Date
    09-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    5

    Re: Unique Values by month in date range

    Hi Daffodil,
    Thank you very much for the suggestion, however, it doesn't count unique Names, so if it sees multiple AA in my example xls it counts each of them.

    The pivot table suggestion also doesn't count unique values. I understand that Excel 2013 does provide the ability to show unique counts, however, it won't let me group the dates by months so I can't see how many unique names show up for each month.

    If it's more simple I would be happy to simply see:
    Month Count
    Jan 2013 3
    Feb 2013 6
    Mar 2013 3

    Etc.

    Open to any other suggestions.

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Unique Values by month in date range

    I attached my Pivot Table.

    The count of unique values is accurate for your data sample.

    unique by month.xlsx
    Last edited by daffodil11; 09-25-2013 at 02:58 PM.

  6. #6
    Registered User
    Join Date
    09-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    5

    Re: Unique Values by month in date range

    Thank you again for all your help. I haven't explained what I'm trying to do articulately enough now that I see how you answered. What I'm really trying to count is how many new Names did we add each month. In my example xls the name AA was first added in 6/2013, so I wouldn't want to count it again in later months because it's already been counted.

    My real data set is basically orders, so I'm trying to calculate new customers per month. Does that make more sense?

  7. #7
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Unique Values by month in date range

    Wow, it sure does.

    Unique entries out of the whole set, and the count of the new uniques, per month. Got it.

  8. #8
    Registered User
    Join Date
    09-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    5

    Re: Unique Values by month in date range

    Yeah, it's a bit tricky. Been struggling with this for a few months.

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Unique Values by month in date range

    How about this?

    The formula for Jan 2013 counts if letters match the month.

    For Feb forward, if the sum of the row so far is still zero, it does the same as Jan, and if there are numbers, it leaves it blank.

    The new uniques per month are at the bottom.

    unique by month.xlsx

  10. #10
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Unique Values by month in date range

    We'll have this squared away within the hour.

  11. #11
    Registered User
    Join Date
    09-25-2013
    Location
    New York, NY
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    5

    Thumbs up Re: Unique Values by month in date range

    Holy cow! Amazing...and elegant I might add! Daffodil, I am super impressed and very very thankful!

  12. #12
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Unique Values by month in date range

    And there was much rejoicing!

    Glad I could help. Let me know if you have any issues adapting the formula to your real data.

+ 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. [SOLVED] Gather values using a date range to sum up profits for a single month.
    By Walntek in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-15-2013, 04:22 PM
  2. Count Unique values if they fall between a date range
    By Racecarjoe in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-24-2012, 06:41 PM
  3. Counting Unique values within a specified date range
    By Bubba88d in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-27-2012, 10:48 AM
  4. Count Unique Values within date range
    By onthepitch in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-20-2012, 02:29 PM
  5. Replies: 2
    Last Post: 11-15-2011, 07:02 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