+ Reply to Thread
Results 1 to 4 of 4

Counting distinct values with blank cells produces #DIV/0!

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    97

    Counting distinct values with blank cells produces #DIV/0!

    I am trying to count distinct values of a column based on a date range. But since there are cells within that column the result produces a #DIV/0! Are there other ways to produce this?

    Here is the formula I am using:

    Please Login or Register  to view this content.

    'Error Report Data'!$A$2:$A$25000 = DATES
    $F$5 & $F$4 = DATE RANGE I HAVE SPECIFIED
    'Error Report Data'!$C$2:$C$25000 = VALUES WHERE I WANT A DISTINCT COUNT (HAS BLANK CELLS)


    What I want is give me the distinct count of values in Column C where the dates in Column A are in range of column F


    Thank you!
    Bill

  2. #2
    Forum Guru Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Counting distinct values with blank cells produces #DIV/0!

    What type of data is in 'Error Report Data'!$C$2:$C$25000?

    Is it text? Numbers? Could be both? Something else?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Moderator daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,676

    Re: Counting distinct values with blank cells produces #DIV/0!

    Hello Bill,

    This formula should work for any type of data in column C, and it ignores blanks

    =SUM(IF(FREQUENCY(IF(('Error Report Data'!$A$2:$A$25000<=$F$5)*('Error Report Data'!$A$2:$A$25000>=$F$4)*('Error Report Data'!$C$2:$C$25000<>""),MATCH('Error Report Data'!$C$2:$C$25000,'Error Report Data'!$C$2:$C$25000,0)),ROW('Error Report Data'!$C$2:$C$25000)-ROW('Error Report Data'!$C$2)+1),1))

    confirm with CTRL+SHIFT+ENTER

    If column C is numeric (or dates) you can use a shorter version, i.e.

    =SUM(IF(FREQUENCY(IF(('Error Report Data'!$A$2:$A$25000<=$F$5)*('Error Report Data'!$A$2:$A$25000>=$F$4),'Error Report Data'!$C$2:$C$25000),'Error Report Data'!$C$2:$C$25000),1))

    also array entered
    Audere est facere

  4. #4
    Registered User
    Join Date
    04-02-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    97

    Re: Counting distinct values with blank cells produces #DIV/0!

    Thank very much Tony and daddylonglegs.

    This array formula worked perfectly

    =SUM(IF(FREQUENCY(IF(('Error Report Data'!$A$2:$A$25000<=$F$5)*('Error Report Data'!$A$2:$A$25000>=$F$4),'Error Report Data'!$C$2:$C$25000),'Error Report Data'!$C$2:$C$25000),1))

+ 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] Counting blank cells between two values
    By ssc351 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 05-03-2016, 02:51 PM
  2. [SOLVED] counting unique/distinct values (sample data attached)
    By justinhampton81 in forum Excel General
    Replies: 9
    Last Post: 08-06-2014, 12:41 AM
  3. Replies: 2
    Last Post: 10-05-2011, 12:30 PM
  4. Counting Distinct cells
    By bronkista in forum Excel General
    Replies: 4
    Last Post: 06-09-2011, 05:04 PM
  5. Counting Distinct Values
    By giantwolf in forum Excel General
    Replies: 4
    Last Post: 12-29-2005, 11:03 AM

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