+ Reply to Thread
Results 1 to 6 of 6

Formula with if smaller and larger then followed by a calculation

  1. #1
    Registered User
    Join Date
    10-03-2019
    Location
    Brussels
    MS-Off Ver
    2016
    Posts
    3

    Formula with if smaller and larger then followed by a calculation

    Hello

    I am looking for a formula which can help met out with the following:

    I have 3 columns. X, Y & Z

    In X en Y are numbers. Z is the one i want to create a formula for.

    Next rules has to be respected.

    IF X > Y --> then excel has to calculate 100 - x
    IF X< Y --> then excel has to calculate 100 - y

    Thanks for you help !
    Mathieu
    Last edited by mathieu11; 10-03-2019 at 04:30 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: If formula

    What if x and y are the same?


    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional.)
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-03-2019
    Location
    Brussels
    MS-Off Ver
    2016
    Posts
    3

    Re: Formula with if smaller and larger then followed by a calculation

    Hello,

    Thank you for letting me know, i hope now it's a better title.

    In my specific case it is impossible X and Y are the same, but for the correctness you can state outcome may be 0 if they are the same. Thank you for you help !

    Kind Regards,
    Mathieu

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Formula with if smaller and larger then followed by a calculation

    Thanks for fixing the title.

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


    Or, if x cannot equal y, then just
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-03-2019
    Location
    Brussels
    MS-Off Ver
    2016
    Posts
    3

    Re: Formula with if smaller and larger then followed by a calculation

    Hello !

    Thank you very much, it's what i was looking for !

    I have one more thing to ask, is it possible to change the colour of the cell if outcome is produced by X>Y (red) and X<Y (green) ?

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,445

    Re: Formula with if smaller and larger then followed by a calculation

    You're welcome. Thanks for the rep.

    You would use Conditional Formatting for that. Just select all the data, choose Conditional Formatting on the Ribbon, and use the formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    for red

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

+ 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: 3
    Last Post: 01-10-2019, 09:34 AM
  2. Replies: 5
    Last Post: 02-16-2018, 06:50 AM
  3. Replies: 8
    Last Post: 09-22-2017, 05:41 AM
  4. Excel formula bar to display the result of the formula , not the formula?
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-18-2016, 07:15 PM
  5. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  6. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 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