+ Reply to Thread
Results 1 to 4 of 4

Multiple IF - Date within a range

  1. #1
    Registered User
    Join Date
    05-18-2010
    Location
    Europe
    MS-Off Ver
    Excel 2010
    Posts
    54

    Multiple IF - Date within a range

    Hi all,

    I want to check if a date is between two specific dates and if it is also after a third date.

    a b c d
    1 DATE TO CHECK APPROVAL START DATE END DATE
    2 25-Feb-2011 20-Feb-2011 20-Feb-2011 19-May-2011

    I tried

    =IF(AND($A2>=B$2,$A2>=$C2,$A2<=D2),"ok","not ok")

    but it does not work! Did I make any mistake?
    For example in this case I got "not ok" even if it should be "ok".

    Can it be related to the cell format??

    Thanks!!!

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Multiple IF - Date within a range

    I get "ok". Are you sure the dates are entered as Dates and not as text.

    If you select each date you should see the date in the formula bar formatted as: m/d/yyyy (e.g. 2/25/2011).

    If not, then enter a 0 into any blank cell and copy it, then select the dates and go to Edit|Paste Special and select Add.

    Then format the cells as Date.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Multiple IF - Date within a range

    gives ok for me check all cells contain real dates and not text
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    05-18-2010
    Location
    Europe
    MS-Off Ver
    Excel 2010
    Posts
    54

    Re: Multiple IF - Date within a range

    indeed it was the text formatting!
    I tried to make text to date in all the ways I know but it did not work!
    I had to write manually each date!

    Anyway thanks for your help. at least the formula was correct

+ 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