+ Reply to Thread
Results 1 to 15 of 15

Multiple IF Statements With One Not Working

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    Sunshine Coast
    MS-Off Ver
    Excel for Mac 2011
    Posts
    83

    Question Multiple IF Statements With One Not Working

    Hey

    I have the following formula that not all elements are not working

    Here is the formula: =IF(J2=R2,"No Movement",IF(R2<J2,"Widening",IF(J2<R2, "Closing",IF(R2>0, "Closed"))))

    So the No Movement, Widening, Closing all work. I'm trying to get the Closed to work now, File attached

    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Multiple IF Statements With One Not Working

    That's because it doesn't work logically. What if R2=J2 and both are bigger than 0? And so on. In what way is that final requirement meant to work?
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    Sunshine Coast
    MS-Off Ver
    Excel for Mac 2011
    Posts
    83

    Re: Multiple IF Statements With One Not Working

    I've just added the "Closed" criteria. I only want it to say "Closed" when the number is larger than Zero
    Most of the numbers are negative numbers

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Multiple IF Statements With One Not Working

    But it won't work unless the number fails to meet all of the criteria that come before it - do you see? That's the problem.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Multiple IF Statements With One Not Working

    Which cell in your sample workbook do you think should return "Closed"? You haven't said.

  6. #6
    Registered User
    Join Date
    07-04-2012
    Location
    Sunshine Coast
    MS-Off Ver
    Excel for Mac 2011
    Posts
    83

    Re: Multiple IF Statements With One Not Working

    The ones where Column R are above Zero and Green

  7. #7
    Forum Contributor
    Join Date
    01-09-2016
    Location
    Perth Western Australia
    MS-Off Ver
    Office 365
    Posts
    257

    Re: Multiple IF Statements With One Not Working

    Hi

    It would help if the meaning of the columns was disclosed to understand what you are trying to achieve with "Closed"
    The following solves the equation though
    Please Login or Register  to view this content.
    Cheers
    Last edited by FoxSeaLady; 11-04-2018 at 09:21 AM. Reason: Formula ommitted

  8. #8
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Multiple IF Statements With One Not Working

    Trying to help ...

    If you change the order of the questions, starting at the end
    Last edited by José Augusto; 11-04-2018 at 09:26 AM. Reason: Same as previous post

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Multiple IF Statements With One Not Working

    Quote Originally Posted by ioswoody View Post
    The ones where Column R are above Zero and Green
    In this case, use the formula offered in post #7.

    Do you understand now why it won't work with that criterion at the end of the set of IF statements? If not, you must say, as this is a fundamental logic issue that you need to understand going forward.

  10. #10
    Registered User
    Join Date
    07-04-2012
    Location
    Sunshine Coast
    MS-Off Ver
    Excel for Mac 2011
    Posts
    83

    Re: Multiple IF Statements With One Not Working

    Quote Originally Posted by AliGW View Post
    In this case, use the formula offered in post #7.

    Do you understand now why it won't work with that criterion at the end of the set of IF statements? If not, you must say, as this is a fundamental logic issue that you need to understand going forward.
    No, Excel is not my gifting. Hence why I am asking for help on a forum website
    To me we have asked: is it higher than 0, then is it equal to 0, then is it a bigger difference, then is it a smaller difference (which doesn't make sense in my head)

  11. #11
    Registered User
    Join Date
    07-04-2012
    Location
    Sunshine Coast
    MS-Off Ver
    Excel for Mac 2011
    Posts
    83

    Re: Multiple IF Statements With One Not Working

    Quote Originally Posted by FoxSeaLady View Post
    Hi

    It would help if the meaning of the columns was disclosed to understand what you are trying to achieve with "Closed"
    The following solves the equation though
    Please Login or Register  to view this content.
    Cheers
    That does the trick - Thanks!

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Multiple IF Statements With One Not Working

    Quote Originally Posted by ioswoody View Post
    No, Excel is not my gifting. Hence why I am asking for help on a forum website
    To me we have asked: is it higher than 0, then is it equal to 0, then is it a bigger difference, then is it a smaller difference (which doesn't make sense in my head)
    When you put together a nested series of IF statements, Excel will deal with each one in turn. If any criterion = TRUE, it returns the required result and stops looking any further. In the case of R2, because J2<R2 (-11 is less than 5), it returns "Closing" - it will not go any futher because it has already found a fit.

    This is why you have been advised to put the IF(R2>0,"Closed" criterion first.

    I hope this helps you to understand how it works.
    Last edited by AliGW; 11-04-2018 at 09:53 AM.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Multiple IF Statements With One Not Working

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  14. #14
    Registered User
    Join Date
    07-04-2012
    Location
    Sunshine Coast
    MS-Off Ver
    Excel for Mac 2011
    Posts
    83

    Re: Multiple IF Statements With One Not Working

    Right, I understand now, with Closing and Closed being very similar (due to the nature of the question and the dataset, where the goal is to have R2 less than J2), you, in essence, have them at separate ends so both are engaged during the process.
    In most cases, they are going to be Widening or Closing (whereas it will skip past the Closed option to find Closing where required)

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,647

    Re: Multiple IF Statements With One Not Working

    So are you happy that the suggested tweak to the formula fulfills all your requirements? If so, please mark the thread as solved.

+ 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. Multiple IF statements are not working
    By ImranBhatti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2017, 10:05 AM
  2. [SOLVED] Multiple IF statements not working
    By ohanish in forum Excel General
    Replies: 2
    Last Post: 03-19-2015, 11:41 AM
  3. [SOLVED] Multiple IF Statements are working as I would like
    By NZL_Truly in forum Excel General
    Replies: 4
    Last Post: 02-15-2015, 02:20 AM
  4. Multiple If Statements Working, with Errors
    By jseward in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-21-2013, 05:13 PM
  5. Multiple IF Statements Working Together
    By DragonballZ in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-31-2009, 10:23 AM
  6. VLookup/IF Statements and Multiple Variable Lookup Not Working Correctly
    By gustafsoni in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-15-2007, 08:50 AM
  7. Multiple IF THEN ELSE statements not working
    By johnnywinter in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-04-2007, 08:14 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