+ Reply to Thread
Results 1 to 8 of 8

IF, AND, OR Function:True is equation with neg result, False is equation with pos result

  1. #1
    Registered User
    Join Date
    06-06-2021
    Location
    New Orleans, LA
    MS-Off Ver
    Microsoft for Mac 16.49
    Posts
    4

    Exclamation IF, AND, OR Function:True is equation with neg result, False is equation with pos result

    Good Afternoon,
    After searching for over an hour I am reaching out for help with the following formula:

    =IF(OR(AND(F11=Bow,B7=Port), AND(F11=Stern,B7=Starboard)),"(F17*F10)/D8","(F17*F10)/D8)"

    To explain:
    When drafting a vessel if the trim is to the bow and testing is done on the port side then the resulting answer should be a negative number.
    Likewise, if the trim is to the stern and testing is done on the starboard side then the resulting answer should be negative.

    Checking my formula, Excel recognizes the logic and the resulting "true", "false"; however, it is not producing any result in testing, nor can I accomplish input to render the "true" result a negative in the equation.

    Online currently and looking for quick response.

    Thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,027

    Re: IF, AND, OR Function:True is equation with neg result, False is equation with pos resu

    The syntax of the formula as you have written it here doesn't make sense--in particular, the quotes don't work. Is it supposed to be something like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    That doesn't make sense either because the True result and the False result are identical.

    It's hard to assess without knowing what's in F11, B7, and how the names Bow, Port, Stern, and Starboard are defined. The way you have written this formula, these are named ranges, not strings. Also, we can't tell what's negative and what's positive without knowing what is also in F17, F10, and D8.

    Any chance that you could attach the file? (see yellow banner at the top of the page)
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    06-06-2021
    Location
    New Orleans, LA
    MS-Off Ver
    Microsoft for Mac 16.49
    Posts
    4

    Exclamation Re: IF, AND, OR Function:True is equation with neg result, False is equation with pos resu

    Thanks for the quick reply Jeff!
    I added the quotes thinking that the formula needed to be encapsulated as the result but then deleted after posting here.
    So the current syntax is correct.
    The "True" result should be a negative result of the same equation as the "False" which would remain positive.
    The equation is meant to calculate variables that will result in a factor for a subsequent equation, and in that equation this variable will be calculated to produce another variable based on either a subtraction or addition based on whether it is positive or negative.
    Please reference the "Worksheet" tab in the attached workbook.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    06-06-2021
    Location
    New Orleans, LA
    MS-Off Ver
    Microsoft for Mac 16.49
    Posts
    4

    Re: IF, AND, OR Function:True is equation with neg result, False is equation with pos resu

    Sorry! The syntax wasn't corrected in what I sent but in reviewing your syntax I realized I lacked spaces before the results, which allowed me to change one result to a negative result; however, it still does not calculate a result.
    See attached.
    Attached Files Attached Files

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    27,027

    Re: IF, AND, OR Function:True is equation with neg result, False is equation with pos resu

    The problem is that you want to check to see if F11 contains the string "Bow" but instead you are checking to see if it is equal to the named range Bow, which does not exist. You need to put the text strings in quotes. This is the formula you want:

    =IF(OR(AND(F11="Bow",B7="Port"), AND(F11="Stern",B7="Starboard")), (-F17*F10)/D8, (F17*F10)/D8)

  6. #6
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2504 and WPS V2024(12.1.0.18543)
    Posts
    4,061

    Re: IF, AND, OR Function:True is equation with neg result, False is equation with pos resu

    Formula

    =IF(OR(AND(F11="Bow",B7="Port"), AND(F11="Stern",B7="Starboard")),(F17*F10)/D8,(F17*F10)/D8)

    OR

    =IF(OR(AND(F11={"Bow","Stern"},B7={"Port","Starboard"})),(F17*F10)/D8,(F17*F10)/D8)

  7. #7
    Registered User
    Join Date
    06-06-2021
    Location
    New Orleans, LA
    MS-Off Ver
    Microsoft for Mac 16.49
    Posts
    4

    Re: IF, AND, OR Function:True is equation with neg result, False is equation with pos resu

    That did it!
    Thank you very much!

  8. #8
    Forum Expert wk9128's Avatar
    Join Date
    08-15-2020
    Location
    China Shanghai
    MS-Off Ver
    365 V2504 and WPS V2024(12.1.0.18543)
    Posts
    4,061

    Re: IF, AND, OR Function:True is equation with neg result, False is equation with pos resu

    You're Welcome. Thank You for the feedback and for marking 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. [SOLVED] If the IF function result is false then check the next cell until get a true result
    By Beag air Bheag in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-10-2017, 08:55 AM
  2. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  3. [SOLVED] Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. Can Excel operate a function based on a true or false result?
    By StinkeyPete in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 09:05 AM
  5. [SOLVED] Can Excel operate a function based on a true or false result?
    By StinkeyPete in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 AM
  6. [SOLVED] Can Excel operate a function based on a true or false result?
    By StinkeyPete in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 05:05 AM
  7. Can Excel operate a function based on a true or false result?
    By SteveD in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11: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