+ Reply to Thread
Results 1 to 7 of 7

COUNTIF Function for Dates not working

  1. #1
    Registered User
    Join Date
    02-29-2024
    Location
    Sheffield, England
    MS-Off Ver
    2312
    Posts
    2

    Angry COUNTIF Function for Dates not working

    Good Morning!

    I am trying to create a summary tab on my sheet which shows the total number of expired dates in a given range.

    Here is a little background of the project I am trying to undertake so you have some context:

    I have a tab with certificate expiry dates on for various certificates in different columns which are not together (I.E Column A, then column D, then column H)

    I am trying to create a summary tab to show how many expired certificates we have overall

    The formula I am trying to use is:

    =COUNTIF('Field Staff - A4L'!D4,'Field Staff - A4L'!D4:D20,'Field Staff - A4L'!G4:G20,'Field Staff - A4L'!J4:J21,'Field Staff - A4L'!M4:M20,'Field Staff - A4L'!P4:P20,'Field Staff - A4L'!S4:S20,'Field Staff - A4L'!V4:V20,'Field Staff - A4L'!Y5:Y20,'Field Staff - A4L'!AB4:AB20,"<="&TODAY())

    My range is actually quite a bit longer than that, but I have shortened it for the purpose of sharing it here.

    I am not even getting an error returned, when I hit enter the formula just stays like it is incomplete.

    Please tell me where I am going wrong! Or any suggestions on a different method I could use would be much appreciated.

    Many Thanks in advance!


    EDIT 12:57 - 29/02/2024

    I have attached a sample workbook with the formula provided below used[ATTACH]861301
    Attached Files Attached Files
    Last edited by Maisy; 02-29-2024 at 09:22 AM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.90.2 (24102719))
    Posts
    8,969

    Re: COUNTIF Function for Dates not working

    countif - wont work for more than 1 range
    countifs()
    needed
    BUT if a lot of different columns
    then maybe need a countifs()+countifs()

    what version of excel do you have
    MS-Off Ver
    2312
    dont follow that - is that the actual version
    2007, 2010, 2013, 2016,2019, 2021 , 365 versions ???

    as a guess
    I have a tab with certificate expiry dates on for various certificates in different columns which are not together (I.E Column A, then column D, then column H)
    =countif('Field Staff - A4L'!AB4:AB20,"<="&TODAY()) + countif('Field Staff - A4L'!A4:A20,"<="&TODAY()) + countif('Field Staff - A4L'!D4:D20,"<="&TODAY()) + countif('Field Staff - A4L'!H4:H20,"<="&TODAY())

    not sure why AB , as you only mention A,D,H columns

    anyway .....

    A sample sheet would help here, and possibly will enable a quicker and more accurate solution for you.


    The forum does allow for spreadsheets to be uploaded direct to the forum -

    Please see the Yellow Banner at the top of the page explaining how to attach a sample spreadsheet

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.

    Here are the instructions, found at the top of the page again
    Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT confidential information (10-20 rows, not thousands...) and some manually calculated results. For a new thread (1st post), scroll to Manage Attachments, otherwise scroll down to GO ADVANCED, click, and then scroll down to MANAGE ATTACHMENTS and click again. Now follow the instructions at the top of that screen.
    Last edited by etaf; 02-29-2024 at 07:48 AM.
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,004

    Re: COUNTIF Function for Dates not working

    If you have a common header on columns D,G etc then you can use

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    so above assumes header of "MyHeader" in row 3.
    Last edited by JohnTopley; 02-29-2024 at 08:09 AM.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  4. #4
    Registered User
    Join Date
    02-29-2024
    Location
    Sheffield, England
    MS-Off Ver
    2312
    Posts
    2

    Re: COUNTIF Function for Dates not working

    Hi,

    Thanks for your help!

    I have attached a sample workbook, the formula seemed to *half* work! I have included some comments on the workbook.

    In regards to your comments of 'not sure why AB , as you only mention A,D,H columns. anyway …..' As explained, I had quite a bit of data so the formula I pasted would've been exceptionally long so I deleted half the formula for ease of viewing here. A,D,H Columns were just used as an example again for ease of viewing here, in reality I actually have around 20 columns I want to pull from which would've made a very long and unnecessary list!
    Last edited by Maisy; 02-29-2024 at 09:19 AM.

  5. #5
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.90.2 (24102719))
    Posts
    8,969

    Re: COUNTIF Function for Dates not working

    ok, before looking at the sample
    did you see johntopley suggestion
    do you have headers as he suggested ?

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.90.2 (24102719))
    Posts
    8,969

    Re: COUNTIF Function for Dates not working

    i'm sure this can be simplied with a LET and using rows() or cols() somehow instead of the multiple use of choosecols

    anyway
    =COUNTA(FILTER(VSTACK(CHOOSECOLS(B2:P10,3),CHOOSECOLS(B2:P10,6),CHOOSECOLS(B2:P10,9),CHOOSECOLS(B2:P10,12),CHOOSECOLS(B2:P10,15)),VSTACK(CHOOSECOLS(B2:P10,3),CHOOSECOLS(B2:P10,6),CHOOSECOLS(B2:P10,9),CHOOSECOLS(B2:P10,12),CHOOSECOLS(B2:P10,15))<TODAY()))

    works on the same sheet - just need to add sheet name

    watch for an edit
    obviously need to extend the
    CHOOSECOLS(B2:P10,3),
    to the other 20+ blocks
    But as its every 3 , sure its easier with a formula

    EDIT
    johntopley - replied with the sumproduct example working
    I will not do anymore now with the very complicated formula above
    Last edited by etaf; 02-29-2024 at 09:23 AM.

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,004

    Re: COUNTIF Function for Dates not working

    Based on your sample file

    Please Login or Register  to view this content.
    Or

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by JohnTopley; 02-29-2024 at 09:43 AM.

+ 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. COUNTIF Function Not Working
    By yunowork in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-18-2014, 01:37 AM
  2. Countif function not working at all on Mac
    By galaxytraveler42 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-08-2014, 05:31 PM
  3. [SOLVED] COUNTIF function not working
    By joshdocs in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-31-2013, 07:22 AM
  4. Countif Function not working
    By Quillow in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-25-2013, 04:54 PM
  5. [SOLVED] COUNTIF function not working
    By RoyLittle0 in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 06-29-2013, 08:14 AM
  6. Excel 2007 : Countif function Not working correctly
    By carl.spackler in forum Excel General
    Replies: 12
    Last Post: 04-09-2012, 06:39 PM
  7. Countif with nested function not working?
    By jshuatree in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-17-2006, 05:55 PM

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