+ Reply to Thread
Results 1 to 5 of 5

How to show a positive difference between two numbers

  1. #1
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    How to show a positive difference between two numbers

    I want to enter a number in A1, then enter another number in A2 and show the difference in A3.
    Using this formula (=MAX(A1)-A2) works great until the number I enter in A2 is higher than in A1. Then I get a negative number.
    How can I get a positive answer to show in A3 regardless of whether or not the number in A2 is higher or lower than in A1?
    Positive differences.xlsx

    Thank you
    Last edited by tom hatten; 03-12-2015 at 03:50 PM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: How to show a positive difference between two numbers

    Use the ABS() absolute value function: =ABS(number1-number2)
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: How to show a positive difference between two numbers

    Thank you MrShorty, exactly what I wanted.

  4. #4
    Forum Contributor
    Join Date
    08-21-2010
    Location
    Bournemouth, England
    MS-Off Ver
    Microsoft 365
    Posts
    215

    Re: How to show a positive difference between two numbers

    I'm really sorry but I've jumped the gun a bit and thought I could solve the second half of my problem but it's throwing up errors.

    Following on from my first post:
    If A2 is the same as A1 then I want A4 to equal 10
    If A2 is within 3 of A1 then I want A4 to equal 5
    If A2 is within 5 of A1 then I want A4 to equal 3
    If A2 is greater then 5, I want A4 to equal 0

    Thank you

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: How to show a positive difference between two numbers

    I guess I did not see your additional question last week.

    If I understand what you are trying to do, I would probably do this using a lookup table and lookup function (see VLOOKUP() function, for example: https://support.office.com/en-us/art...8-93a18ad188a1 ) A lookup table like
    Please Login or Register  to view this content.
    and a lookup function like =VLOOKUP(A3,$D$2:$E$5,2,true) (where A4 has your ABS(...) function and D2:E5 contains the lookup table).

+ 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. I need answer to only show positive numbers, not minus numbers or zeros
    By stevedork in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-24-2013, 01:18 PM
  2. Replies: 4
    Last Post: 09-12-2012, 10:31 PM
  3. Show negative numbers as positive in a pivot
    By Cunner in forum Excel General
    Replies: 0
    Last Post: 11-22-2011, 10:30 AM
  4. adding positive and negative numbers all as positive
    By tomvh444 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-18-2009, 04:08 PM
  5. [SOLVED] Show % Difference between two numbers
    By Jana in forum Excel General
    Replies: 7
    Last Post: 02-03-2006, 03:20 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