+ Reply to Thread
Results 1 to 4 of 4

If statement excluding cells with non-numeric values

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    San Antonio
    MS-Off Ver
    Excel 2010
    Posts
    45

    If statement excluding cells with non-numeric values

    Good morning,

    I am working on a spreadsheet that has dates in 2 columns. In a third column I have placed a formula that will display the umber of days elapsed between the two, only if there is a date in both referenced cells. This is the formula I have, that works well: =IF((AND(L8>0, H8>0)), L8-H8, " ")

    The last step that I cannot figure out is how to display nothing (" ") if there is something other than a date, or numeric value in one of the date cells. For example, the folks that keep the spreadsheet up to date with put "----" in the cell if there is not a date. How can I edit the above formula to not display an error if one of the date cells contains a non-numeric value?

    Thanks in advance.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,723

    Re: If statement excluding cells with non-numeric values

    You could do it this way:

    IF(AND(ISNUMBER(L8), ISNUMBER(H8)), L8-H8,"")

    Note there should not be a space between "".

    Hope this helps.

    Pete

  3. #3
    Valued Forum Contributor
    Join Date
    02-05-2013
    Location
    Jakarta, Indonesia
    MS-Off Ver
    Excel 2013
    Posts
    571

    Re: If statement excluding cells with non-numeric values

    Hi, tylerf

    May be you need IFERROR() function
    Please Login or Register  to view this content.
    or use this (if H8 and L8 are Date (D1) with format d-mmm-yy or dd-mmm-yy then L8-H8 else "")
    Please Login or Register  to view this content.
    Last edited by SDCh; 03-07-2013 at 10:57 AM. Reason: add another formula
    Click (*) if you received helpful response.

    Regards,
    David

  4. #4
    Registered User
    Join Date
    03-07-2013
    Location
    San Antonio
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: If statement excluding cells with non-numeric values

    thank you! the IFERROR() FUNCTIONED worked!

+ 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