+ Reply to Thread
Results 1 to 7 of 7

CountIfS not working as expected

  1. #1
    Registered User
    Join Date
    11-11-2014
    Location
    United States
    MS-Off Ver
    MS Office 2013
    Posts
    37

    CountIfS not working as expected

    Hi,

    I am hoping someone can shed some light on what I am doing wrong within this formula. I am also trying to add aging 0-1day, 2-5 day, 6-10 day and over 10.

    I am using this formula to count:
    =COUNTIFS(general_report!O2:O281,"<=1",general_report!A1:A281,"=Incident", general_report!F1:F281,"=P1")

    When I use this formula I receive an error #VALUE! however if I break it up I the results are correct meaning.
    =COUNTIFS(general_report!O2:O281,"<=1",general_report!A1:A281,"=Incident") THIS WORKS

    =COUNTIFS(general_report!F1:F281,"=P1") THIS WORKS

    =COUNTIFS(general_report!O2:O281,"<=1",general_report!A1:A281,"=Incident", general_report!F1:F281,"=P1") THIS DOESN'T work. :/

    On a side note I am trying to figure out how to report on age the "Day's Open" if anyone can give me any tips in this area I would be very, very happy.

    Thanks,

    Ruth S.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: CountIfS not working as expected

    What do you mean by "it doesn't work"?

    Just because one, or even pairs of conditions are met, it doesn't mean that all three will be met.

    You could filter the raw data to check what you get for Priority 1 Incidents.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: CountIfS not working as expected

    This formula contains an error ... =COUNTIFS(general_report!O2:O281,"<=1",general_report!A1:A281,"=Incident", general_report!F1:F281,"=P1")

    The three ranges you listed are NOT the same size. The "O" column is one row shorter than the "A" or "F" Column ... change "O2:O281" to "O1:O281"

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: CountIfS not working as expected

    =COUNTIFS(general_report!O2:O281,"<=1",general_report!A1:A281,"=Incident") cannot work as the ranges are not the same size
    but your first formula when corrected to
    =COUNTIFS(general_report!O1:O281,"<="&1,general_report!A1:A281,"Incident", general_report!F1:F281,"P1")
    gives a result of 3
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    11-11-2014
    Location
    United States
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: CountIfS not working as expected

    Well see below this when I filter on the same criteria they do exist see below. That was the first thing I checked because early on I added "New", "Open" from a single filed and 0 records returned and :/ CountIFS looks for all criteria to return so I removed it. That isn't the case here and I can not figure out what I did wrong.
    Incident-1.JPG

  6. #6
    Registered User
    Join Date
    11-11-2014
    Location
    United States
    MS-Off Ver
    MS Office 2013
    Posts
    37

    Re: CountIfS not working as expected

    OMG! and I have been sitting here for about 2 hours trying to figure out what it was I was doing wrong and trying a bunch of different things.

    Any idea on how I can add aging? I need to be able to take "days open" and then how many of those cases fall into 0-1day, 2-5 day, 6-10 day and over 10 (aging). Then I have to figure out the percentage based on the total cases of that type.

    Thanks again for your help!

  7. #7
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,069

    Re: CountIfS not working as expected

    You're welcome. Thanks for the rep.


    Why not just use a Pivot Table? You might need to add a helper column to add groups of days open.

+ 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] Struggling with COUNTIFS function returning 0 when value expected
    By vbalearnerdriver in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-03-2014, 06:32 AM
  2. [SOLVED] countifs working on extended ranges and different sheets not working
    By etaf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-18-2013, 02:23 PM
  3. [SOLVED] Countifs In Array Not Working As Expected, then Update question
    By jcaynes in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2013, 06:53 PM
  4. [SOLVED] Countifs array results not as expected, can anyone see why?
    By jason.b75 in forum Excel General
    Replies: 6
    Last Post: 07-15-2012, 01:45 PM
  5. For Each Statement not working as expected
    By Jacqui in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:20 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