+ Reply to Thread
Results 1 to 5 of 5

I need COUNTIFS or SUMPRODUCT formula to count ONLY Non-Consecutive values

  1. #1
    Registered User
    Join Date
    06-24-2013
    Location
    New York
    MS-Off Ver
    Excel 2011
    Posts
    24

    I need COUNTIFS or SUMPRODUCT formula to count ONLY Non-Consecutive values

    I've attached both a screenshot image, and a sample file to this post. I'm trying to count the number of instances where the values in Column F ("Position") fall within the range indicated in Column A ("Position Size Range") BUT to not double-count values, which are defined as those values that appear consecutively in Column F.

    So, for example, my total count for Column F should equal 186, but instead it counts 472, because it's counting all occurences and not just the non-consecutive occurences. I've tried array formulas from Domenic posted on other boards, but that doesn't seem to exactly meet my needs.

    Ideally, I'd prefer not use an array formula, too, unless that's the only way to achieve my goal. I am not looking for a VBA solution either.

    CountIfs Example.jpg
    Attached Files Attached Files
    Last edited by justinbelkin; 09-19-2013 at 02:04 PM. Reason: Now Solved

  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: I need COUNTIFS or SUMPRODUCT formula to count ONLY Non-Consecutive values

    This works if you remove the spaces between the positions. (This can be done quickly by selecting F3:F5000, choose Find & Select -> Special, choose Blanks. Hit Okay, then click the Delete button on Cells menu.)

    Plop this into E3. =SUMPRODUCT((1/COUNTIF($F$3:$F$474,$F$3:$F$474)*($F$3:$F$474>=1)*($F$3:$F$474<=2500)))

    There are actually 197 unique values.
    Last edited by daffodil11; 09-19-2013 at 01:28 PM.

  3. #3
    Registered User
    Join Date
    06-24-2013
    Location
    New York
    MS-Off Ver
    Excel 2011
    Posts
    24

    Re: I need COUNTIFS or SUMPRODUCT formula to count ONLY Non-Consecutive values

    Thank you daffodil11. That did work perfectly. It would be nice to be able to not have to delete the blanks, however, I suppose that would require an array formula?

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

    Re: I need COUNTIFS or SUMPRODUCT formula to count ONLY Non-Consecutive values

    Indeed. I will think upon it.

    Problems are just learning opportunities. There's always another workaround.

  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: I need COUNTIFS or SUMPRODUCT formula to count ONLY Non-Consecutive values

    If you're not averse to using a helper column and an array, a formula could be utilized to filter the unique values values automatically in ascending order in a separate column.

    Then with the application of INDIRECT to create a dynamic range, you wouldn't have to worry about manipulating your data source.

    MAX would identify the row with the last consecutive nonblank cell, MATCH would pull back that row #, and INDIRECT would let you create ranges for the formula from G3 to GXXX and the final version would look something like:

    Please Login or Register  to view this content.

+ 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: 17
    Last Post: 06-27-2014, 04:25 PM
  2. [SOLVED] Need to use either COUNTIFS or SUMPRODUCT to count rows based on multiple criteria
    By erabinov in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-15-2013, 03:15 PM
  3. Trying to use the COUNTIFS formula, but might need SUMPRODUCT instead?
    By jeepjenn in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-25-2013, 12:02 PM
  4. Count First set of Consecutive Values
    By sushi637 in forum Excel General
    Replies: 3
    Last Post: 05-19-2010, 03:05 PM
  5. [SOLVED] Count Intervals of 2 Consecutive Values in same Row and Return Count across Row
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-29-2005, 11:30 AM

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