+ Reply to Thread
Results 1 to 4 of 4

Excel Formula returning True Value for False Formula

Hybrid View

  1. #1
    Registered User
    Join Date
    12-24-2014
    Location
    la, usa
    MS-Off Ver
    2003
    Posts
    22

    Excel Formula returning True Value for False Formula

    I am having a problem with a formula I've written. Here it is in its original form:

    =IF(A8="","",IF((B8-A8)<"4:00","",IF(A8+"4:00"<A$4,"!",A8+"4:00")))
    On cells where this should have been returning the last True value ("!"), it was instead coming up blank. After replacing the "" value after IF((B8-A8)<"4:00"... (where the product of B8-A8 was actually 8:30) with "error", I discovered it was because my formula is returning the True value for that condition, even though it is actually false.

    I even tried replacing the "4:00" format with the general numeric value of the numbers (i.e. replacing "4:00" with 0.1667.) Running a simple calculation in another cell (B8-A8) confirmed that the result was 8:30 or 0.3542.

    So... can anyone tell me why this formula thinks that 8:30 (or 0.3542) is less than 4:00 (0.1667)?

    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,816

    Re: Excel Formula returning True Value for False Formula

    You are comparing (B8-A8) with a string value ("4:00"). You need to change those times in quotes to numbers, either by adding -- before them (--"4:00"), or adding zero ("4:00"+0) or multiplying by one ("4:00"*1). It would be safer to use the TIME function (TIME(4,0,0) ).

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-24-2014
    Location
    la, usa
    MS-Off Ver
    2003
    Posts
    22

    Re: Excel Formula returning True Value for False Formula

    Quote Originally Posted by Pete_UK View Post
    You are comparing (B8-A8) with a string value ("4:00"). You need to change those times in quotes to numbers, either by adding -- before them (--"4:00"), or adding zero ("4:00"+0) or multiplying by one ("4:00"*1). It would be safer to use the TIME function (TIME(4,0,0) ).

    Hope this helps.

    Pete
    That did the trick. Thanks.

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Excel Formula returning True Value for False Formula

    Reply Removed
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

+ 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. IF Stmt Returning a TRUE FALSE Value
    By J41 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-27-2014, 08:50 AM
  2. [SOLVED] Changing default TRUE and FALSE responses in Excel Formula
    By ineedasandwich in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-09-2014, 01:58 PM
  3. Excel True and False formula help
    By sphex in forum Excel General
    Replies: 9
    Last Post: 03-14-2011, 10:32 PM
  4. Returning True/False/Maybe
    By RivFin in forum Excel General
    Replies: 1
    Last Post: 02-03-2011, 06:29 PM
  5. Formula for returning True (1) or False(0)
    By wish2excel in forum Excel General
    Replies: 5
    Last Post: 10-11-2010, 04:14 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