+ Reply to Thread
Results 1 to 6 of 6

Sum greater or lower.

  1. #1
    Registered User
    Join Date
    01-21-2020
    Location
    Atlanta, GA
    MS-Off Ver
    2013
    Posts
    4

    Sum greater or lower.

    The scenario is I have 4 cells, F2, G2, H2, and I2. F2 has a number in it. I put a number in G2 and I need the difference of the two to go in either H2 or I2. If the difference is higher than F2 then the difference would go to H2. If the difference is lower than F2 then the difference would go to I2. What formulas would I put into H2 and I2?
    Attached Files Attached Files
    Last edited by RedRay56; 01-21-2020 at 11:08 AM.

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

    Re: Sum greater or lower.

    Hi RedRay56,

    Welcome to the forum! Try this:

    In cell H2: =IF((G2-F2)>F2,(G2-F2),"")
    In cell I2: =IF((G2-F2)<F2,(G2-F2),"")

    What would you like to happen if the difference is the same?

    Hope this helps.

    Snook

  3. #3
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,743

    Re: Sum greater or lower.

    f
    g
    h
    i
    2
    10
    15
    0
    5
    3
    10
    21
    11
    0


    f
    g
    h
    i
    2
    10
    15
    =((g2-f2)>f2)*(g2-f2)
    =((g2-f2)<f2)*(g2-f2)
    Last edited by KOKOSEK; 01-21-2020 at 10:24 AM.
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Sum greater or lower.

    You have also not defined the difference

    eg g2=10, f2=5 difference 5

    g2=5 f2=10 difference is 5 or -5?

    does the solution do what you expect? it might need changine to abs (g2-f2)?

  5. #5
    Registered User
    Join Date
    01-21-2020
    Location
    Atlanta, GA
    MS-Off Ver
    2013
    Posts
    4

    Re: Sum greater or lower.

    The result I care for would not show the negative but show the number. If it was "-5" then it would show as "5" in either cell. I'm not great with Excel. I attached a sample of the spread sheet I'm using.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,568

    Re: Sum greater or lower.

    It may help if you update the sample to show some hypothetical numbers that might appear in columns F and G and the corresponding values you would expect to see in columns H and I (manually calculated) so that we have something against which to compare the output of our proposed formulas/code.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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: 09-24-2015, 06:46 AM
  2. [SOLVED] find value which is greater than in a range of cells and return the greater value
    By green369 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-11-2015, 02:46 AM
  3. [SOLVED] count values greater 2 or greater in a column.
    By ammartino44 in forum Excel General
    Replies: 3
    Last Post: 09-16-2014, 07:05 PM
  4. copying a formula to 8 cells lower with a result of 1 cell lower
    By dyosa in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-21-2014, 11:52 PM
  5. most recent greater and lower date
    By dweb in forum Excel General
    Replies: 1
    Last Post: 08-17-2011, 06:11 PM
  6. Replies: 2
    Last Post: 05-31-2010, 03:23 PM
  7. Replies: 4
    Last Post: 08-25-2009, 06:39 AM

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