+ Reply to Thread
Results 1 to 6 of 6

CountIF Function for dates

  1. #1
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52

    Smile CountIF Function for dates

    Hi All, Just need a little help with a formula. I want a formula that will count a column of data and let me know how many of the dates in the column are before a set date. e.g. how many dates in the column are before 08/5/06?

    Chris

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Try sumproduct

    http://www.xldynamic.com/source/xld.....html#examples

    Something like

    =SUMPRODUCT(--(A2:A2000<DATEVALUE("08/05/06")*(A2:A2000>0)))

    VBA Noob
    Last edited by VBA Noob; 03-08-2007 at 06:40 AM.
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52
    Currnetly using =COUNTIF(D$10:D$155,"<08/04/2006")

    how can i suplement the date of 08/04/06 with a cell reference with an ever changing number?

    Chris

  4. #4
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    As suggested above, use SUMPRODUCT:

    =SUMPRODUCT(--(D$10:D$155<F1))

    Where F1 is the referenced date cell.

    HTH

    Jason

  5. #5
    Registered User
    Join Date
    12-15-2003
    Location
    UK
    Posts
    52
    Great, the sum product formula works but i need it to exclude blank cells, any idea how to do this?

    Chris

  6. #6
    Forum Expert
    Join Date
    12-29-2004
    Location
    Michigan, USA
    MS-Off Ver
    2013
    Posts
    2,208
    Sure:

    =SUMPRODUCT(--(D$10:D$155<F1)*(D$10:D$155<>""))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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