+ Reply to Thread
Results 1 to 13 of 13

Date less than greater than

Hybrid View

  1. #1
    Registered User
    Join Date
    01-30-2008
    Posts
    8

    Unhappy Date less than greater than

    I think I'm going mad! I've searched for the solution everywhere - either i'm not entering the right search parameters or ....I am mad.

    I have a list of dates B2:B248. All the cells have been formatted to date type dd/mm/yyyy.

    I'm just trying to count the number that are earlier than a certain date.

    I thought a COUNTIF function would work! I've tried DATE, DATEVALUE etc.

    I can work with the dates ie B2 (which would have 23/08/2007)-1 comes out as 22/08/2007. However when I try if(B2<B3,"lower","higher") it gives me a false reading - even when B2 is earlier than B3.

    How can I check if my list of dates is earlier than a specified date please?

    this should be so simple yet it's driving me mad.

    many thanks.

    J.

  2. #2
    Registered User
    Join Date
    04-02-2007
    Posts
    35

    Countif

    you were right you can use countif

    i just placed a range of dates in column a for this sample

    then the criteria date in c5 and the formula below in d5

    =COUNTIF(A1:A37,"<"&C5)

    watch out for the " " around the operator

    hope that helps

  3. #3
    Registered User
    Join Date
    01-30-2008
    Posts
    8
    Okay I'm trying this...

    =COUNTIF(B2:B248,"<"&A250)

    ...and in cell A250 I have the date 17/08/2007.

    I know for a fact that in the selection B2:B248 I have several dates earlier than that in A250, but the result is coming up 0.

    Any pointers?

    J

  4. #4
    Registered User
    Join Date
    04-02-2007
    Posts
    35

    strange

    looks like it shoudl be working, can you attach the file or copy it out to a new book and attach??

  5. #5
    Registered User
    Join Date
    01-30-2008
    Posts
    8
    I know!

    I just tried your formula on a seperate bit using just a few dates and it worked fine! I'll have to investigate a bit further.

    Does it matter what the format of the cells are? Date, General ...etc


    J

  6. #6
    Registered User
    Join Date
    04-02-2007
    Posts
    35

    format

    it should not make a load of diff. dates are represented as a numeric (think it is the number of days since 1900 or something like that). so in theory if you changed the format to number you would see what it is evaluating against.

    today is 39477 for example

+ 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