Results 1 to 6 of 6

Why does adding an IF statement alter the outcome of the calculation occasionally?

Threaded View

  1. #1
    Registered User
    Join Date
    09-05-2022
    Location
    Sarpsborg, Norway
    MS-Off Ver
    Microsoft 365
    Posts
    3

    Question Why does adding an IF statement alter the outcome of the calculation occasionally?

    I am trying to calculate overtime, and am using the following simple setup (file attached):

    A1: 07:30
    B1: 15:15

    C1: =((B1-A1)*1440)-465 This will show a positive value if the difference between A1 & B1 is more than 465 minutes, and a negative value if it's below 465. I get 0, which is correct
    C2: =IF(A2,((B2-A2)*1440)-465,"") Should give the same outcome, as long as A2 is not empty. I get -0.00000000000005684342 ...


    However, if I repeat the same process with 08:30-16:15, both formulas give me the correct answer, 0

    Why is this happening?
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Formula to alter calculation dependant on drop down list value
    By peterderrington in forum Excel Formulas & Functions
    Replies: 34
    Last Post: 03-12-2021, 09:53 AM
  2. [SOLVED] IF statement with variable outcome
    By Jeff Rich in forum Excel General
    Replies: 9
    Last Post: 01-17-2020, 04:55 PM
  3. [SOLVED] if statement third outcome
    By steddas in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-08-2018, 09:57 AM
  4. Calculation - Adding IF statement to existing logic
    By bdav1216 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-27-2016, 10:37 AM
  5. [SOLVED] how to alter my select statement
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-04-2016, 10:43 AM
  6. [SOLVED] Multiple outcome if and statement
    By retroboy17 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-08-2014, 02:09 AM
  7. [SOLVED] issue with outcome of if/then statement in VBA
    By Marijke in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-19-2013, 10:18 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