+ Reply to Thread
Results 1 to 8 of 8

Counting Values Within and Outside of a Range

  1. #1
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    259

    Counting Values Within and Outside of a Range

    Good afternoon, Experts and Gurus!

    I’ve got a list of POs, and I want to count those within the range of 100000000000 and 100009999999, then those outside of that range. I can get the former to work just fine; it’s the latter that’s evading me. I’m 99.9999% sure the answer is staring me right in the face (that it’s yet again my missing the “AND” forest for the “OR” trees as I am often wont to do,) but I can’t for the life of me suss it out. Little help?
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Counting Values Within and Outside of a Range

    Formula: =COUNTIFS($A$2:$A$8,"> 100000000000",$A$2:$A$8,"< 100009999999")
    In words: Count the number of cells in A2:A8 that are greater than 100000000000 AND less than 100009999999.

    If you want to count the number of cells in A2:A8 that are outside of that range, that would look like this:

    Formula: =SUM(COUNTIFS($A$2:$A$8,{"<= 100000000000",">= 100009999999"}))
    In words: Count the number of cells in A2:A8 that are less than or equal to 100000000000 OR are greater than or equal to 100009999999.
    Last edited by 63falcondude; 04-16-2018 at 02:23 PM.

  3. #3
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    259

    Re: Counting Values Within and Outside of a Range

    Yes, that most certainly does work; thank you!! Curious that it's more complex than I thought it'd be; I didn't expect I'd need to use an array, i.e.: I've never successfully used one that wasn't in a solution provided by someone on this forum!

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Re: Counting Values Within and Outside of a Range

    Good evening Mvaldesi

    An alternative simpler option is to work out all numbers below 100000000000, and add to all numbers above 100009999999, thus :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    HTH

    DominicB

  5. #5
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    259

    Re: Counting Values Within and Outside of a Range

    Quote Originally Posted by dominicb View Post
    Good evening Mvaldesi

    An alternative simpler option is to work out all numbers below 100000000000, and add to all numbers above 100009999999, thus :
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    HTH

    DominicB
    See, I knew I was overthinking it. This is the solution I probably would have eventually stumbled upon eventually, but I get so fixated on figuring out why my initially thought process doesn't work, I get in my own way. Thank you!

  6. #6
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Counting Values Within and Outside of a Range

    Thanks for the rep!

    The reason for the array is to avoid a COUNTIFS()+COUNTIFS() formula (like the one in post #4). Both will work just fine.

    The thing to keep in mind is that COUNTIFS acts as an AND operator when you have multiple criteria.

    The formula that you had in C3 counted the number of cells in A2:A8 that are greater than 100000000000 AND less than 100009999999.

    Since 100000000000 < 100009999999, that formula will always return 0 because there is no number that is both greater than 100000000000 AND less than 100009999999.

  7. #7
    Forum Contributor Mvaldesi's Avatar
    Join Date
    01-21-2011
    Location
    Plano, TX
    MS-Off Ver
    MS365 (PC) v.2108
    Posts
    259

    Re: Counting Values Within and Outside of a Range

    It always makes perfect and obvious sense when one of you Gurus or Experts explain it to me; thank you both!

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Counting Values Within and Outside of a Range

    Glad we could help!

+ 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 values in a range
    By mellenbal in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-28-2017, 10:47 AM
  2. [SOLVED] Counting values within a range
    By uklancs in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-27-2013, 06:48 AM
  3. [SOLVED] Counting values within a range
    By rowena229 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-17-2013, 03:59 PM
  4. Counting values within a range
    By rowena229 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-17-2013, 02:52 PM
  5. Counting Values in a Range
    By Locust in forum Excel General
    Replies: 5
    Last Post: 11-01-2010, 04:10 PM
  6. Counting by a Range of Values?
    By Ender in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-07-2006, 06:10 PM
  7. Counting a Range of Values
    By slyverson in forum Excel General
    Replies: 0
    Last Post: 09-01-2005, 05:21 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