+ Reply to Thread
Results 1 to 6 of 6

=IF Function and Blank Date Cells

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Colorado
    MS-Off Ver
    365
    Posts
    80

    =IF Function and Blank Date Cells

    Need some help with rewriting the following formula if the the cell (G11) is blank:


    =IF((MONTH(G11))>(MONTH('General Data'!C2)),"Y","N")


    If the cell is blank, I'd like to return the "N" value. Nothing I've tried seems to work, but if G11 has a date in it, it works perfectly.

    Any help would be greatly appreciated.

    Thanks so much!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: =IF Function and Blank Date Cells

    =IF(OR(G11="",MONTH(G11)<=MONTH('General Data'!C2)),"N","Y")
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    04-16-2013
    Location
    Colorado
    MS-Off Ver
    365
    Posts
    80

    Re: =IF Function and Blank Date Cells

    Thanks Special-K, I had tried that as well, but it returns #Value error for the cells that are blank (works great if the cell as a date in it). I tried changing the "number format" to general, text, etc., but I still receive the error. Really not sure what the problem is.

    Cell G11 currently contains this formula:
    =IFERROR(1/(1/INDEX('Employee Data'!$AO$2:$AO$88,MATCH($A11,'Employee Data'!$A$2:$A$88,0))),"")

    so I don't know if this is what is causing the problem with this formula =IF(OR(G11="",MONTH(G11)<=MONTH('General Data'!C2)),"N","Y") being used in J11.

    The things that make you go hmmmmm.

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: =IF Function and Blank Date Cells

    Ah, G11 is returning "", that is not actually BLANK.
    So the month("") is returning an error.

    You have to test for G11="" seperately, not in an OR

    =IF(G11="","N",=IF((MONTH(G11))>(MONTH('General Data'!C2)),"Y","N"))

  5. #5
    Registered User
    Join Date
    04-16-2013
    Location
    Colorado
    MS-Off Ver
    365
    Posts
    80

    Re: =IF Function and Blank Date Cells

    Thanks Jonmo1!!! That worked with the " = " sign removed from the second "IF" function! So the formula that worked was:

    =IF(G11="","N",IF((MONTH(G11))>(MONTH('General Data'!C2)),"Y","N"))

    AWESOME!!!! Thanks for your help! ~doing a happy dance~

  6. #6
    Registered User
    Join Date
    04-16-2013
    Location
    Colorado
    MS-Off Ver
    365
    Posts
    80

    Re: =IF Function and Blank Date Cells

    Rats, that didn't work as well as I thought. With this formula, I want the return value to be "Y" ONLY if the month of my formula cell is GREATER than the month of G11. Unfortunately, if the Month's are the SAME, it is also returning the value "Y", when it should "N".

    So if my G11 date is 5/1/13 and my ('General Data'!C2) date is 5/13/13, it should return "N" (but with this formula, it returns "Y") :-( It should only return "Y" if the date was 6/1/13 or greater.

    Any ideas??

+ 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