+ Reply to Thread
Results 1 to 5 of 5

Nested If function

  1. #1
    Registered User
    Join Date
    06-28-2020
    Location
    Harrisburg
    MS-Off Ver
    2016
    Posts
    3

    Nested If function

    Can you please look into the attachment and tell me where am I going wrong? I want my last cell to return 0 when the D is empty.

    Thanks in advance
    Attached Files Attached Files
    Last edited by AliGW; 06-30-2020 at 03:59 PM. Reason: Solved tag correctly applied.

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: Nested If function

    Nested IFs need to be in a specific order depending on how you want it to act.

    Try this rearranged version of your formula:

    =IF(D4="",0,IF(D4>C4,(D4-C4)*B4,IF(D4<C4,(A4-C4)*B4+D4*B4)))

    BSB

  3. #3
    Registered User
    Join Date
    06-28-2020
    Location
    Harrisburg
    MS-Off Ver
    2016
    Posts
    3

    Re: Nested If function

    Dear BSB,
    Thanks for the prompt response. But now with this rearranged version, it is returning 0 for everything. Would you mind re looking at it please

    Thanks

  4. #4
    Registered User
    Join Date
    06-28-2020
    Location
    Harrisburg
    MS-Off Ver
    2016
    Posts
    3

    Re: Nested If function

    Oh my bad,
    I had the formula pasted in the wrong cell. It works perfectly fine.
    Thank you heaps BSB

  5. #5
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,468

    Re: (Resolved) Nested If function

    Happy to help

    BSB

+ 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. Replies: 2
    Last Post: 01-05-2019, 03:33 AM
  2. [SOLVED] Nested vlookup or nested IFAND function?
    By jeptik in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2017, 02:27 AM
  3. Calling function inside function. (aka nested function)
    By jakopak in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-02-2015, 05:58 AM
  4. COUNTIF/COUNTIFS function + nested user-defined function
    By shamjamali in forum Excel General
    Replies: 1
    Last Post: 05-12-2015, 09:12 PM
  5. [SOLVED] Nested Function With Division - Receiving #VALUE! Function Error
    By DDM64 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-17-2013, 01:16 PM
  6. [SOLVED] Nested AND function within IF function is only addressing logical1 but not logical2
    By betic in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-20-2012, 09:17 AM
  7. [SOLVED] Offset function with nested match function not finding host ss.
    By MKunert in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-21-2006, 06:50 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