+ Reply to Thread
Results 1 to 9 of 9

CountIF Statement with multiple criteria using the Today() Function

Hybrid View

  1. #1
    Registered User
    Join Date
    11-05-2019
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    2016
    Posts
    27

    CountIF Statement with multiple criteria using the Today() Function

    Hello,

    I am building a dashboard off off the data contained within my Issue / Action tracker. What I need to do is develop a formula that will allow me to returns a total count of items for 2 areas. Past Due and Upcoming date. I have calculated columns for Status, Formula is =IF(ISBLANK(A15),"",IF(ISBLANK(I15),"Ongoing",IF(ISBLANK(J15),"Open","Closed"))) which will determine if the Item is Open or Closed
    and a Manually entered filed for Due Date.

    I am having an issue with the following formula. It works with the Today() Function, but errors out if I use a <=Today() for Past due and when I use the Today()+10 for "Upcoming Tasks" it does not return the correct data

    The formula I have for Past Due is this =COUNTIFS($K$8:$K$1497,"Open",$I$8:$I$1497,<=TODAY()) and the one I am using for "Upcoming is =COUNTIFS($K$8:$K$1497,"Open",$I$8:$I$1497,TODAY()+10)

    Any suggestions or assistance would be greatly appreciated.

    Attached is a sample of the file. Please be aware that the formula for past due does NOT contain the <= sign as Excel will not allow me to save it, Since I am doing something incorrectly!

    Thank you in advance,
    Tim

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97.2 for Mac MS 365
    Posts
    8,708

    Re: CountIF Statement with multiple criteria using the Today() Function

    try putting "" around your formula like ,"<="&TODAY()
    =COUNTIFS($K$8:$K$1497,"Open",$I$8:$I$1497,"<="&TODAY()+10)

    and the other one is this... =COUNTIFS($K$8:$K$1497,"Open",$I$8:$I$1497,"<="&TODAY())
    Last edited by Sam Capricci; 11-06-2019 at 03:57 PM.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    11-05-2019
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    2016
    Posts
    27

    Re: CountIF Statement with multiple criteria using the Today() Function

    Sambo kid,

    Thank you for the quick reply.

    The formula appears to work, however it does return the wrong value for the total items. It returns a count of 13 and there are only 9 in my file. =COUNTIFS($K$8:$K$1497,"Open",$I$8:$I$1497,"<="&TODAY()+10)

    The formula returns the correct count for Past Due (4) - =COUNTIFS($K$8:$K$1497,"Open",$I$8:$I$1497,"<="&TODAY())

    I am wondering if the "Upcoming Tasks" formula is double counting the Past Due since both formulas have the common syntax of be double counting the date for Today since it reads "<="&TODAY(). I tried testing this by eliminating the < the sign, but then it returns a 0

    Thoughts?

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97.2 for Mac MS 365
    Posts
    8,708

    Re: CountIF Statement with multiple criteria using the Today() Function

    can you post your file you are working with? (remove any confidential info and just enough of a sample so I can see what is going on.)

  5. #5
    Registered User
    Join Date
    11-05-2019
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    2016
    Posts
    27

    Re: CountIF Statement with multiple criteria using the Today() Function

    Sure Thing. I have attached the file. Again, thank you for your assistance.

    Tim

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97.2 for Mac MS 365
    Posts
    8,708

    Re: CountIF Statement with multiple criteria using the Today() Function

    I used the two formulas you have in post #3 and repointed them at columns D and F and they returned 4 for past due and 9 for upcoming.

    this returns 4 =COUNTIFS($F$8:$F$1497,"Open",$D$8:$D$1497,"<="&TODAY())
    this returns 9 =COUNTIFS($F$8:$F$1497,"Open",$D$8:$D$1497,"<="&TODAY()+10)

    I tried it with an IF / THEN statement on a line by line basis and get the same results. I used this in cell J8 and down... =IF(AND(F8="open",D8<=$I$7),"yes","no")
    And it is based on this in I7 =TODAY()+10

  7. #7
    Registered User
    Join Date
    11-05-2019
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    2016
    Posts
    27

    Re: CountIF Statement with multiple criteria using the Today() Function

    Quote Originally Posted by Sambo kid View Post
    I used the two formulas you have in post #3 and repointed them at columns D and F and they returned 4 for past due and 9 for upcoming.

    this returns 4 =COUNTIFS($F$8:$F$1497,"Open",$D$8:$D$1497,"<="&TODAY())
    this returns 9 =COUNTIFS($F$8:$F$1497,"Open",$D$8:$D$1497,"<="&TODAY()+10)

    I tried it with an IF / THEN statement on a line by line basis and get the same results. I used this in cell J8 and down... =IF(AND(F8="open",D8<=$I$7),"yes","no")
    And it is based on this in I7 =TODAY()+10
    Correct those are the same values that I receive. However, if you look at the file, you will see that the results should in fact be: 4 for Past Due and 5 for Upcoming Tasks not 9

    4 for Past Due and the Formula is =COUNTIFS($F$8:$F$1497,"Open",$D$8:$D$1497,"<="&TODAY()) THIS IS CORRECT

    I also receive 9 for "Upcoming Tasks" with the formula of =COUNTIFS($F$8:$F$1497,"Open",$D$8:$D$1497,"<="&TODAY()+10) This is INCORRECT

    I am wondering if it is double counting the Items that are Past Due. Thoughts?

    Thank you

  8. #8
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.97.2 for Mac MS 365
    Posts
    8,708

    Re: CountIF Statement with multiple criteria using the Today() Function

    yes, it definitely is double counting, one way around it would be to alter the second countifs to this...
    =COUNTIFS($F$8:$F$1497,"Open",$D$8:$D$1497,"<="&TODAY()+10,$D$8:$D$1497,">="&TODAY())
    that will return 5, now do you want to include greater than AND equal to today or just greater than today, you should adjust it accordingly.

  9. #9
    Registered User
    Join Date
    11-05-2019
    Location
    Grand Rapids, Michigan
    MS-Off Ver
    2016
    Posts
    27

    Re: CountIF Statement with multiple criteria using the Today() Function

    Thank you, that last formula works perfectly. I appreciate your responsiveness and willingness to help out. Thank you again

    Tim

+ 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] COUNTIF function with multiple criteria
    By az6781 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-10-2015, 01:21 PM
  2. Countif function for multiple criteria
    By ccdawson in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-03-2012, 08:15 AM
  3. COUNTIF with multiple criteria function
    By floribunda in forum Excel General
    Replies: 3
    Last Post: 07-01-2010, 07:33 AM
  4. COUNTIF or SUM function (Multiple criteria) HELP!!
    By Australia in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-19-2005, 03:05 AM
  5. [SOLVED] COUNTIF or SUM function (Multiple criteria) HELP!!
    By Australia in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-19-2005, 02:05 AM
  6. [SOLVED] countif function with multiple criteria
    By Geoff in forum Excel General
    Replies: 1
    Last Post: 08-11-2005, 07:05 PM
  7. Need help brain is jello now countif multiple criteria with today()
    By robertjtucker in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-06-2005, 04:38 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