+ Reply to Thread
Results 1 to 7 of 7

Date Greater Than equal to and Less than equal to (Month and year)

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Date Greater Than equal to and Less than equal to (Month and year)

    Hi,

    From the particular date i am comparing only month and Year and checking Greater than equal to answer and Less than equal to answer. Sample file attached. getting mix match answer. can you try to update with correct formula


    Date1 Date3 Date3 (month and Year) >= Date1 (month and Year) Formula
    25-Mar-2010 01-Dec-2014 FALSE =IF(TEXT(D4,"mmm-yyyy")>=TEXT(A4,"mmm-yyyy"),0)

    Date2 Date4 Date4 (month and Year) <= Date2 (month and Year) Formula
    26-May-2014 01-Jul-2016 FALSE =IF(TEXT(E3,"mmm-yyyy")>=TEXT(B3,"mmm-yyyy"),0))

    Thanks...Senthil
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Date Greater Than equal to and Less than equal to (Month and year)

    Removed: misunderstood requirement
    Last edited by JohnTopley; 03-15-2021 at 03:12 PM.

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Date Greater Than equal to and Less than equal to (Month and year)

    Okay, so you want in G3 Comparing month and year of Date 3 to Date 1 and in I3, comparing Date 4 to Date 2.
    If Date 3 >= Date 1, then 0, otherwise "False" or blank?

    Just for clarifications, if Date 3 (for example) is May 6, 2020 and Date 1 is May 30, 2020, they would be considered equal?
    You set it up such that the you are comparing the texts to each other so it's just looking at it alphabetically.

    Maybe in G3
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    In F3
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Re: Date Greater Than equal to and Less than equal to (Month and year)

    Thanks, but not getting correct answer, when i apply formula in sample.

    =(month(d3)*10000+year(d3)>=month(a3)*10000+year(d3))

    04-May-2020 >= 01-Jun-2015, getting response as True, correct answer is false

    =(month(e3)*10000+year(f3)<=month(b3)*10000+year(f3))

    26-May-2019 <= 01-Jul-2016, getting response as False, correct answer is True

  5. #5
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Re: Date Greater Than equal to and Less than equal to (Month and year)

    Hi ChemistB,

    Thanks for your updates, In F3 formula, following scenario, i am getting error. any chance this can be fixed?
    =IF(DATE(Year(E3),MONTH(E3),1)<=DATE(Year(B3), MONTH(B3),1),0,"")

    Date 2 is 00-Jan-1900 (this is almost no date), date 4 has 01-Jun-2018, this scenario , i should get response as "True" or "0"

    Thanks Senthil

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: Date Greater Than equal to and Less than equal to (Month and year)

    Try

    =IFERROR(IF(DATE(YEAR(E3),MONTH(E3),1)<=DATE(YEAR(B3), MONTH(B3),1),0,""),0)

    =IFERROR(IF(DATE(YEAR(E3),MONTH(E3),1)<=DATE(YEAR(B3), MONTH(B3),1),0,""),"True")

  7. #7
    Registered User
    Join Date
    09-19-2013
    Location
    India
    MS-Off Ver
    Excel 2019
    Posts
    61

    Re: Date Greater Than equal to and Less than equal to (Month and year)

    Hi JohnTopley and ChemistB,

    Thanks for your updates, below one has resolved.

    =IF(DATE(YEAR(D3),MONTH(D3),1)>=DATE(YEAR(A3), MONTH(A3),1),TRUE,FALSE)
    =IF(B3=0,TRUE,(IF(DATE(YEAR(E3),MONTH(E3),1)<=DATE(YEAR(B3),MONTH(B3),1),TRUE,FALSE)))


    Thanks.. Senthil

+ 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] IF date is greater than or equal to X but less than or equal to y
    By LloydGilmore in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-09-2019, 05:35 AM
  2. If cell value is less than or equal to, OR greater than or equal to
    By Pacific_Quest in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-07-2017, 11:20 AM
  3. Filter column B by equal or greater than 31 but less than or equal to 60
    By kop1ko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-18-2015, 04:11 PM
  4. SumIfs containing a greater than or equal to And less than or equal to
    By teton88 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 04-15-2014, 07:47 PM
  5. [SOLVED] COUNTIFS function w/greater than or equal to, and less than or equal to time values
    By AliciaRenee in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-27-2014, 03:57 PM
  6. Sum multiple columns if year and month equal
    By gav0101 in forum Excel General
    Replies: 3
    Last Post: 04-09-2007, 12:50 AM
  7. [SOLVED] criteria for a given date equal or -greater then-
    By J_J in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-22-2005, 05:06 AM

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