+ Reply to Thread
Results 1 to 5 of 5

Adding Nested IFs gives incorrect Value

  1. #1
    Registered User
    Join Date
    05-16-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2

    Adding Nested IFs gives incorrect Value

    I am having difficulty finding any error with my formula.

    This formula is supposed to give a time in days:minutes:hours format. When I run this formula as it is I get a result of 1:00:00 when it should be 32:00:00. If I delete the last nested IF (after the third "+") the formula yields the correct result of 24:00:00. I have also replaced the last nested IF with a "7" and got 31:00:00. If I replace it with an "8" i get the incorrect 1:00:00 again. If I replace it with a 9 I get 2:00:00. Why is this giving wrong return values when and after I reach a value of 32?

    Formula in question is in Column F of the sample. I will add that when Inputting values into Column B they are in this format: "1/1/1900 12:00:00 AM"

    Edit: Changed to sample per request.
    Attached Files Attached Files
    Last edited by Malk; 05-16-2018 at 12:26 PM.

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,954

    Re: Adding Nested IFs gives incorrect Value

    Attach a sample workbook (not image).so that we do not have to manually key in your data to do a testing.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Registered User
    Join Date
    05-16-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2

    Re: Adding Nested IFs gives incorrect Value

    Quote Originally Posted by JohnTopley View Post
    Attach a sample workbook (not image).so that we do not have to manually key in your data to do a testing.

    Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate.

    Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Edited and attached file to OP

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,954

    Re: Adding Nested IFs gives incorrect Value

    Try

    =((IF(A1="Available",E1,IF(A1="Upgrading",E1-(NOW()-B1),0)))+(IF(A2="Available",E1,IF(A2="Upgrading",E1-(NOW()-B2),0)))+(IF(A3="Available",E1,IF(A3="Upgrading",E1-(NOW()-B3),0)))+(IF(A4="Available",E1,IF(B4="Upgrading",E1-(NOW()-B4),0))))/24


    Or

    correctly format E1 as TIME not Date/Time and enter as 08:00:00

    your formula will then be OK.

    =((IF(A1="Available",E1,IF(A1="Upgrading",E1-(NOW()-B1),0)))+(IF(A2="Available",E1,IF(A2="Upgrading",E1-(NOW()-B2),0)))+(IF(A3="Available",E1,IF(A3="Upgrading",E1-(NOW()-B3),0)))+(IF(A4="Available",E1,IF(B4="Upgrading",E1-(NOW()-B4),0))))

    returns 1:8:00 as d:h:mm or 32:00 as [h]:mm
    Last edited by JohnTopley; 05-16-2018 at 02:37 PM.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,954

    Re: Adding Nested IFs gives incorrect Value

    Alternative is .

    =(SUMPRODUCT(($A$1:$A$4="Available")*$E$1)+SUMPRODUCT(($A$1:$A$4="Upgrading")*($E$1-(NOW()-$B$3:$B$6))))

+ 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] Month Function When Nested inside Text returns incorrect Month Serial Number
    By ibuhary in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-06-2018, 04:12 AM
  2. [SOLVED] Nested IF AND not working as I expect - Returns 'False' so probably is incorrect syntax
    By pongmeister in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-23-2015, 05:38 AM
  3. [SOLVED] Forumula Results Incorrect when data missing. Wanting to hide the incorrect formula.
    By firemedic6265 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-05-2014, 05:01 PM
  4. [SOLVED] Incorrect Adding
    By rizmomin in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-17-2013, 08:42 AM
  5. Incorrect result from adding two cells
    By Marvo in forum Excel General
    Replies: 7
    Last Post: 05-14-2011, 08:12 AM
  6. Incorrect adding
    By mecky in forum Excel General
    Replies: 1
    Last Post: 01-30-2009, 12:13 AM
  7. Nested LOOKUP function returns incorrect data
    By TheAkwardOne in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-29-2008, 12:15 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