+ Reply to Thread
Results 1 to 9 of 9

Sum positive/negative numbers based on text of another cell

  1. #1
    Registered User
    Join Date
    02-17-2020
    Location
    Louisville, KY
    MS-Off Ver
    2016
    Posts
    43

    Sum positive/negative numbers based on text of another cell

    I have one column of numerical data, ten in number, containing both positive and negative numbers, as well as zeros/blanks. In the adjacent column, I have the letter "c" in some but not all of the adjacent cells to the first column. Where there is no "c", the cell is blank.

    I would like to have a formula that sums all of the positive numbers where there is a "c" adjacent and a formula that will do the same for negative numbers.

    Thanks in advance.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,861

    Re: Sum positive/negative numbers based on text of another cell

    Something like this:

    =SUMIFS(A:A,A:A,"<"&0,B:B,"c")

    =SUMIFS(A:A,A:A,">"&0,B:B,"c")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    02-17-2020
    Location
    Louisville, KY
    MS-Off Ver
    2016
    Posts
    43

    Re: Sum positive/negative numbers based on text of another cell

    Thanks, although I just realized I asked for the wrong result.
    What I am really after is a formula that will sum all of the positive numbers in column 1 that have adjacent cells that contain a zero or are blank in column 2; same for negatives.
    Sorry, and thanks again.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,861

    Re: Sum positive/negative numbers based on text of another cell

    This, then?

    =SUMIFS(A:A,A:A,"<"&0,B:B,"")+SUMIFS(A:A,A:A,">"&0,B:B,"")+SUMIFS(A:A,A:A,"<"&0,B:B,0)+SUMIFS(A:A,A:A,">"&0,B:B,0)

  5. #5
    Registered User
    Join Date
    02-17-2020
    Location
    Louisville, KY
    MS-Off Ver
    2016
    Posts
    43

    Re: Sum positive/negative numbers based on text of another cell

    I entered this exact formula, and the result was the TOTAL of ALL of the cells in column 1 that have adjacent cells with a "c", both positive and negative.

    What I am after is 2 formulas: one that will sum all of the positive numbers in the first column that have adjacent cells in column 2 with "c"s, and another that will do the same for all of the negative numbers in column 1.

    Sorry I wasnt more clear.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,861

    Re: Sum positive/negative numbers based on text of another cell

    Well, that’s what the first pair I offered do. We seem to be going round in circles.

  7. #7
    Registered User
    Join Date
    02-17-2020
    Location
    Louisville, KY
    MS-Off Ver
    2016
    Posts
    43

    Re: Sum positive/negative numbers based on text of another cell

    Thanks, I thought they all went together!

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,861

    Re: Sum positive/negative numbers based on text of another cell

    I'm extremely confused - is this solved or not?

  9. #9
    Registered User
    Join Date
    02-17-2020
    Location
    Louisville, KY
    MS-Off Ver
    2016
    Posts
    43

    Re: Sum positive/negative numbers based on text of another cell

    Yes, Im sorry. Thank you again!

+ 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. If statement based on positive and negative numbers.
    By CHSCS in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-17-2019, 12:58 AM
  2. [SOLVED] Format cell colors based on another cell values with positive and negative numbers
    By rlowry in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 03-30-2017, 12:10 PM
  3. Separate positive & negative numbers from on cell
    By tselek1985 in forum Excel General
    Replies: 3
    Last Post: 06-11-2015, 08:14 AM
  4. Replies: 2
    Last Post: 08-04-2014, 08:57 AM
  5. [SOLVED] Deleting Correlating Positive and Negative Numbers based on Criteria
    By amaan.khowaja in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 09-02-2013, 06:49 AM
  6. 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
  7. Replies: 2
    Last Post: 01-19-2009, 02:18 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