+ Reply to Thread
Results 1 to 13 of 13

How to calculate Negative and positive numbers in the same column

Hybrid View

  1. #1
    Registered User
    Join Date
    09-03-2005
    Posts
    57

    How to calculate Negative and positive numbers in the same column

    Hi all.

    I have a column that contain positive and negative numbers. I would like to make a filter to get the final result which are greater the positive or negative for EX:

    The column contain this numbers.

    -15
    20
    -23
    5
    10
    19
    -22

    -15+-23+-22 = -60
    20+5+10+19 = 54

    in this calculation the negative number is greater.

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to calculate Negative and positive numbers in the same column

    Try:
    Formula: copy to clipboard
    =MAX(SUMIF(A1:A7,">0"),-SUMIF(A1:A7,"<"&0))
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    09-03-2005
    Posts
    57

    Re: How to calculate Negative and positive numbers in the same column

    Sorry The result it showing all positive number even if it negative

  4. #4
    Registered User
    Join Date
    09-03-2005
    Posts
    57

    Re: How to calculate Negative and positive numbers in the same column

    Thank you Olly for your help..

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to calculate Negative and positive numbers in the same column

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. You can also 'Add Reputation' to those who helped you. Thanks.

  6. #6
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,657

    Re: How to calculate Negative and positive numbers in the same column

    =IF(SUM(A1:A7)<0,"-","+")&MAX(SUMIF(A1:A7,">0"),-SUMIF(A1:A7,"<"&0))
    Is this better?
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  7. #7
    Registered User
    Join Date
    09-03-2005
    Posts
    57

    Re: How to calculate Negative and positive numbers in the same column

    I think it need to be adjusted. because i add ( 10,-8,-18 ) and the results i got is -18 what it should give me the results as -8

  8. #8
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: How to calculate Negative and positive numbers in the same column

    Quote Originally Posted by savio View Post
    I think it need to be adjusted. because i add ( 10,-8,-18 ) and the results i got is -18 what it should give me the results as -8
    Can you explain that logic? That's not consistent with your original requirement.

    Why should the result be -8, for the input array (10, -8, -18) ? The logic from your original post would sum the negative numbers, and give a result of -26.

  9. #9
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,657

    Re: How to calculate Negative and positive numbers in the same column

    =max(A1:A7)+min(A1:A7)

  10. #10
    Registered User
    Join Date
    09-03-2005
    Posts
    57

    Re: How to calculate Negative and positive numbers in the same column

    Sorry to say it still not working. it give the result as 0 for
    10
    -8
    -10

  11. #11
    Registered User
    Join Date
    09-03-2005
    Posts
    57

    Re: How to calculate Negative and positive numbers in the same column

    Sorry. Yes it should show the result as -16, but it's not

  12. #12
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to calculate Negative and positive numbers in the same column

    why don't you simply sum the values?

    =Sum(A1:A7)
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  13. #13
    Registered User
    Join Date
    09-03-2005
    Posts
    57

    Re: How to calculate Negative and positive numbers in the same column

    Thanks its working fine.

+ 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. Ranking Positive and Negative Numbers in a Column
    By tim.morley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-09-2018, 10:43 AM
  2. Replies: 1
    Last Post: 04-14-2015, 08:34 PM
  3. Convert negative to positive in sheet containing both positive/negative numbers
    By sa02000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-29-2010, 07:52 PM
  4. Replies: 3
    Last Post: 12-17-2009, 09:14 AM
  5. Replies: 2
    Last Post: 09-28-2005, 12:05 PM
  6. How to turn positive numbers in a column to negative numbers ?
    By Dbase Beginner in forum Excel General
    Replies: 1
    Last Post: 03-30-2005, 03:14 AM
  7. Replies: 3
    Last Post: 03-24-2005, 03: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