+ Reply to Thread
Results 1 to 13 of 13

Nested IF Returns FALSE

  1. #1
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Nested IF Returns FALSE

    Really can't see where i've got the syntax wrong here, please help:


    =IF($E17<>"",IF(MOD(F$6,INDEX($D$17:$D$18,MATCH($E17,$B$17:$B$18,)))=0,"int",IF(MOD(F$6,$D17)=0,"x","")))

    When $E17 is not blank then it works fine, but when $E17 is blank it returns FALSE, when it should be "".

    I have attached a sample spreadsheet
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Nested IF Returns FALSE

    Hi 77highland,

    You've omitted the 'value if false' part of the syntax from your second IF statement.

    Try:

    =IF($E17<>"",IF(MOD(F$6,INDEX($D$17:$D$18,MATCH($E17,$B$17:$B$18,)))=0,"int",IF(MOD(F$6,$D17)=0,"x",""),""))

    Regards,

    Snook

  3. #3
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: Nested IF Returns FALSE

    Hi Snook,

    Thank you for the super quick reply but unfortunately I had already tried your suggestion and it returns "you've entered too many arguments for this function"

  4. #4
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Nested IF Returns FALSE

    Hmmm, how about this?

    =IF($E17<>"",IF(MOD(F$6,INDEX($D$17:$D$18,MATCH($E17,$B$17:$B$18,)))=0,"int",IF(MOD(F$6,$D17)=0,"x","")),"")

  5. #5
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: Nested IF Returns FALSE

    Unfortunately that returns nothing when $E17 is blank. Could it be due to the INDEX/MATCH not being able to return anything and therefore in theory returning an N/A?

  6. #6
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    W: 2021 H: 365
    Posts
    940

    Re: Nested IF Returns FALSE

    Quote Originally Posted by 77highland View Post
    but when $E17 is blank it returns FALSE, when it should be "".
    I thought that was the result you were expecting?

  7. #7
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,072

    Re: Nested IF Returns FALSE

    Unfortunately that returns nothing when $E17 is blank.
    But that's what you said you wanted.

  8. #8
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: Nested IF Returns FALSE

    Sorry.... it returns "" for all cells. Some cells should return the true statement of "x"......... as per the attached example sheet

  9. #9
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,072

    Re: Nested IF Returns FALSE

    Are you talking about the formula in F8 or F9, as there is nothing in row 17?

  10. #10
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: Nested IF Returns FALSE

    My apologies, I was trying to protect sensitive data.......Please find attached an updated example sheet.

    Now referencing the formula at issue in row 9:

    =IF($E9<>"",IF(MOD(F$6,INDEX($D$8:$D$9,MATCH($E9,$B$8:$B$9,)))=0,"int",IF(MOD(F$6,$D9)=0,"x","")))
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,072

    Re: Nested IF Returns FALSE

    Why have you changed the formula in F9?
    It looks as though the formula you had previously worked & just needed a tweak to get rid of the FALSE.

  12. #12
    Registered User
    Join Date
    10-15-2018
    Location
    London, England
    MS-Off Ver
    365
    Posts
    75

    Re: Nested IF Returns FALSE

    This was a tricky one to explain and I appreciate your help, but I have managed to figure it out Essentially I needed to include an additional If(MOD(x,x)=0 argument as the final false statement

    If interested I have attached an updated example sheet.

    Formula in F8 = =IF($E8<>"",IF(MOD(F$6,INDEX($D$8:$D$9,MATCH($E8,$B$8:$B$9,)))=0,"int",IF(MOD(F$6,$D8)=0,"x","")),IF(MOD(F$6,$D8)=0,"x",""))
    Formula in F9 = =IF($E9<>"",IF(MOD(F$6,INDEX($D$8:$D$9,MATCH($E9,$B$8:$B$9,)))=0,"int",IF(MOD(F$6,$D9)=0,"x","")),IF(MOD(F$6,$D9)=0,"x",""))
    Attached Files Attached Files

  13. #13
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,072

    Re: Nested IF Returns FALSE

    Glad you were able to sort it & thanks for the feedback.

+ 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] returns #N/A instead of a FALSE value
    By kao in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 09-08-2017, 08:19 AM
  2. [SOLVED] Nested HLOOKUP returns "FALSE" in cell where result should be "0.00"
    By gammccubbin in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-09-2016, 09:49 AM
  3. [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
  4. False Returns
    By adsxvii in forum Excel General
    Replies: 7
    Last Post: 11-26-2007, 07:04 AM
  5. How to do nothing if @IF returns FALSE?
    By PMorrisDuke in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-11-2006, 11:45 AM
  6. [SOLVED] IF Function returns False instead of 0
    By Peo Sjoblom in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-06-2005, 07:05 AM
  7. [SOLVED] IF Function returns False instead of 0
    By BEEJAY in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

Tags for this Thread

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