+ Reply to Thread
Results 1 to 6 of 6

Dates - greater than or less than

  1. #1
    Registered User
    Join Date
    11-16-2013
    Location
    Belfast
    MS-Off Ver
    Excel 2010
    Posts
    25

    Dates - greater than or less than

    I'm trying to find if C2, which contains a month (e.g., "September"), occurs after D1 (D1 is a full date, so I just extract the month; e.g., "June") AND before H1 (e.g., October). Here's my formula:

    IF(AND(C2>TEXT(D1,"mmmm"),C2<TEXT(H1,"mmmm")),"Yes","No")

    When I evaluate the formula, it says the first statement is true (September > June) but that the second statement is false (September < October). This makes no sense to me. Any help?

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Dates - greater than or less than

    your converting dates to text then comparing text against text ?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Dates - greater than or less than

    If you are just trying to compare only the months, you can try the following formula:

    D1: 25-Jun-14, H1: 25-Nov-14, C2: September

    =IF(AND(MONTH(D1)<MONTH(DATEVALUE(C2&"-1")),MONTH(H1)>MONTH(DATEVALUE(C2&"-1"))),"YES","NO")
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-16-2013
    Location
    Belfast
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Dates - greater than or less than

    Thank you, cbatrody for the solution!!! And thanks to humdingaling for pointing out that I was comparing text to dates.

  5. #5
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Dates - greater than or less than

    You are welcome

    If that takes care of your question, please mark this thread as Solved by selecting Thread Tools --> Mark thread as solved.

    Also, you can directly thank those who have helped you by clicking on the small * (star) icon located in the lower left corner of a post that you have found to be helpful.

  6. #6
    Registered User
    Join Date
    11-16-2013
    Location
    Belfast
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: Dates - greater than or less than

    Done, thank you.

+ 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. [SOLVED] Sum Values If Greater than or less than given dates
    By aworfolk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-11-2013, 02:01 AM
  2. countif for greater than/less than dates
    By uncleslinky in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-10-2013, 11:08 AM
  3. SUMIFS Between dates that are greater than zero
    By stevencjones in forum Excel General
    Replies: 2
    Last Post: 12-31-2008, 10:50 AM
  4. Greater than dates
    By RGB in forum Excel General
    Replies: 1
    Last Post: 07-17-2006, 06:55 AM
  5. Comparing Dates using Greater Than and Less than
    By waipio2 in forum Excel General
    Replies: 1
    Last Post: 06-08-2005, 11:05 AM

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