+ Reply to Thread
Results 1 to 2 of 2

countifs not returning correct value

  1. #1
    Registered User
    Join Date
    02-17-2015
    Location
    England
    MS-Off Ver
    2010
    Posts
    32

    countifs not returning correct value

    Hi,

    just wanted to understand why this formula doesn't return the value i want. I would be grateful if you could explain/fix the countifs statement, however I have a sumproduct that does the same job but apparently they are slower to run.

    this is the countifs statement - the bold section is the bit that doesn't "work" I have two columns of data that this is looking at - Action limit contains a limit which is different on some rows (i.e I1 = 1, I2 = 2, I3 = 5) and count is a number (K1 = 1, K2 = 0, K3 = 2). I want the formula to compare the action limit on that particular row with the count and if the count is greater than or equal return a 1. So this example should return 1, but instead returns 2. This seems to just look at the first row action limit and compare that against all counts rather than each row separately.
    Please Login or Register  to view this content.
    This works
    Please Login or Register  to view this content.
    Hope this makes sense and grateful for any help as always.

  2. #2
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: countifs not returning correct value

    I think you've got the range vs. values swapped in the syntax of the COUNTIFS?

    Quote Originally Posted by MP1989 View Post
    This seems to just look at the first row action limit and compare that against all counts rather than each row separately.
    That is very much how COUNT is designed to work. It compares a range to a given value, and returns a match (or greater/equal/less than) for each step down the range against that one value. It's not supposed to be doing any math comparing the values in two ranges at each index.

    Anyway, SUMPRODUCT will be... 3-to-5 times slower is the number I've seen thrown around, but I haven't done any testing myself. So unless you're up in more than 100,000 cells long in the ranges, it shouldn't matter much. If you're down in the thousandish territory for your table definition, you likely won't have a human-detectable difference in calc time.
    Click the [* Add Reputation] Button to thank people for help!
    Post Attachment: Click [Go Advanced] under the reply box; then click [Manage Attachments] to launch the attachments dialogue.
    Mark Thread Solved: Go to the top of the first post; Select [Thread Tools] dropdown; Pick the [Mark thread as Solved] option.

+ 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] Countifs no returning the correct value
    By lizsantiago07 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-13-2017, 11:08 PM
  2. Countifs returning Zero
    By MikeSham in forum Excel General
    Replies: 5
    Last Post: 07-20-2016, 05:53 PM
  3. Replies: 4
    Last Post: 01-06-2016, 08:24 PM
  4. [SOLVED] CountIfs returning 0
    By jsmilke in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-19-2015, 04:59 PM
  5. [SOLVED] COUNTIFS returning #VALUE!
    By photoryan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-18-2013, 01:07 AM
  6. [SOLVED] Unsure how to fill my Rows with correct COUNTIFS and vlookups
    By dmejia174 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2013, 05:51 AM
  7. Formula sometimes returning correct answer and sometimes returning 0
    By redimp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2010, 06:28 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