Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Location
    Shetland Isles, Shetland, Scotland
    Posts
    154
    Thanks
    3
    Thanked 1 Time in 1 Post

    countif between two dates (2000 SR1)

    What's the simplest way to count how many entries in a column of dates are between two dates (preferrably without nesting)

    Thanks
    Jim

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: countif between two dates (2000 SR1)

    Say that your date entries are in A1:A100, and that the start and end dates you want to compare them to are in C1 and C2. Then you can use the following formula:

    =COUNT(IF((A1:A100>=C1)*(A1:A100<=C2),A1:A100))

    entered as an array formula, that is, confirm with Ctrl+Shift+Enter instead of Enter. This formula includes dates equal to those in C1 and C2. If you want to exclude those, use > and < instead of >= and <=.

  3. #3
    Uranium Lounger
    Join Date
    Jan 2001
    Location
    South Carolina, USA
    Posts
    7,295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: countif between two dates (2000 SR1)

    If the dates are in A1:A30, and you want to count the number between (inclusive the end dates) 1/10/2002 and 1/20/2002, ten you could use the following:

    [pre]
    =COUNTIF(A1:A30,">="&DATEVALUE("1/10/2002"))-COUNTIF(A1:A30,">"&DATEVALUE("1/20/2002"))
    [pre]
    Legare Coleman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •