+ Reply to Thread
Results 1 to 3 of 3

How do I not include duplicate values in my function?

  1. #1
    Registered User
    Join Date
    11-09-2016
    Location
    Denver, Colorado
    MS-Off Ver
    MS 2010
    Posts
    2

    How do I not include duplicate values in my function?

    I have been given a set of data that is made up of dates ranging from 1/1/2013-12/31/2015. I have been asked to determine how many days each year Employee #2 has made a sale (i.e. how many days in 2013, 2014, 2015)

    For example:

    Employee two has sales recorded on these dates:
    Column E:

    1/1/2013
    1/1/2013
    1/1/2013
    1/2/2013
    1/5/2013
    1/6/2013
    1/6/2013
    1/10/2013

    Right now, for 2013, I have:

    =COUNTIFS(E25:E8095, ">=1/1/2013", E25:E8095, "<=12/31/2013"

    However, I do not want it to count 1/1/2013 three times, I just want it to record it once. How do eliminate duplicate values in my equation?

    Thank you!

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: How do I not include duplicate values in my function?

    You could use column F (or some other empty column) as a helper to filter out those duplicate values, using a formula like this in F25:

    =IF(COUNTIF(E$25:E$8095,E25)=1,YEAR(E25),"")

    then copy that down to F8095. Then your counting formula would become:

    =COUNTIF(F$25:F$8095,2013)

    and similar for the other years (just change the 2013).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-08-2014
    Location
    Missouri
    MS-Off Ver
    365
    Posts
    87

    Re: How do I not include duplicate values in my function?

    **** revised -- my first suggestion didn't work ****

    This will give you a total of unique values, but not by year:

    =SUM(--(FREQUENCY($E$25:$E$8095,$E$25:$E$8095)<>0))


    To get it to test by a specific year, you can wrap it in a SUMPRODUCT():

    =SUMPRODUCT((FREQUENCY($E$25:$E$8095,$E$25:$E$8095)<>0)*(YEAR($E$25:$E$8096)=2013))


    Note that the segment of the formula in bold actually extends 1 row further than the range of dates. That's intentional; don't let it trip you. (see sample, attached)
    Attached Files Attached Files
    Last edited by eibi; 11-09-2016 at 03:13 PM.

+ 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. How to not include NA values with LINEST function
    By haralds in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2014, 01:30 PM
  2. Large function with duplicate values
    By jrs362 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-28-2012, 06:27 AM
  3. using match function for duplicate values
    By enocht in forum Excel General
    Replies: 9
    Last Post: 07-12-2010, 11:11 PM
  4. [SOLVED] Using Match function with duplicate values in an array
    By Richard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. [SOLVED] Using Match function with duplicate values in an array
    By bj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  6. Using Match function with duplicate values in an array
    By Richard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  7. [SOLVED] Using Match function with duplicate values in an array
    By Richard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  8. Using Match function with duplicate values in an array
    By Richard in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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.6.0 RC 1