+ Reply to Thread
Results 1 to 4 of 4

IF Statement to check for blanks first

  1. #1
    Registered User
    Join Date
    09-04-2012
    Location
    Liverpool
    MS-Off Ver
    Excel 2010/2013
    Posts
    17

    IF Statement to check for blanks first

    I have 3 columns:-

    Required Date, Actual Date & Status

    I am using the following formula to place text in the Status Column to indicate whether I was early, on time, or late depending on the difference between the dates.

    =IF(K47>J47,"LATE",IF(K47=J47,"ON TIME","EARLY"))

    The formula works fine where I have 2 dates (i.e. on ein each of the first 2 columns), however...

    I get the word LATE when the Required Date is blank and the Actual Date is filled.
    I get the word ON TIME when both are blank.

    I understand why I get this but I want the Status column to be blank unless both columns have valid dates.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: IF Statement to check for blanks first

    Maybe this?

    =IF(or(K47="",J47=""),"",IF(K47>J47,"LATE",IF(K47=J47,"ON TIME","EARLY")))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-04-2012
    Location
    Liverpool
    MS-Off Ver
    Excel 2010/2013
    Posts
    17

    Re: IF Statement to check for blanks first

    That's spot on Ford, many thanks

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: IF Statement to check for blanks first

    you'r welcome. If this answered your question, please take a moment to mark the thread as "solved" - it helps keep things neat and tidy lol, and consider adding the reputation to those that helped (see points 2 & 3 below my 1st post to 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] If statement with blanks
    By JennOlsen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-26-2014, 07:14 PM
  2. Check cells for blanks then prompt user
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-28-2013, 05:09 AM
  3. [SOLVED] Need to check 2 cells to see what of 2 values or blanks are to be entered into one cell
    By Launchnet in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-29-2013, 10:54 PM
  4. Check for Blanks within a selection range
    By Eamonn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-27-2011, 02:29 PM
  5. Check for blanks within Pivot with VBA
    By tmck in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2010, 02:39 PM

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