+ Reply to Thread
Results 1 to 12 of 12

Sum values in one column when values in another column are greater than zero

  1. #1
    Registered User
    Join Date
    03-26-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Question Sum values in one column when values in another column are greater than zero

    What formula(s) would I need to accomplish the following:

    Base Table:
    1 2 3
    A 0 5 10
    B 10 0 20
    C 15 0 5


    Result Table:
    1 2 3
    1 25 0 10
    2 0 5 5
    3 25 10 30

    In the Result Table:
    - the value in Row 3, Column 1 = 25 since in the base table:
    Column = 1: Row A = 0, Row B > 0 and Row C > 0
    Since Row A, Column 1 = 0 (exclude it)
    Since Row B, Column 1 > 0 (keep it, 20)
    Since Row C, Column 1 > (keep it, 5)

    Sum result, 0 + 20 + 5 = 25

    Thanks for any assistance on this.
    Last edited by mstrauss; 03-03-2014 at 06:12 PM.

  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,410

    Re: Sum values in one column when values in another column are greater than zero

    It would probably be easier to follow if you used the "standard references" to rows and columns. Rows go across the sheet and are numbered down the left hand side. Columns go down the sheet and have alphabetic references across the top. Rows = Horizontal = Left to Right. Columns = Vertical = Top to Bottom.

    What would be even better is a sample workbook with some typical data and an explanation, on the sheet, of the expected outcome and how it is calculated.

    Regards, TMS
    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
    03-26-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Sum values in one column when values in another column are greater than zero

    Sorry, example data spreadsheet is attached.

    Hope this explains what I'm trying to do.

    Thanks.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    03-15-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Sum values in one column when values in another column are greater than zero

    Example Data.xlsxSee attached

  5. #5
    Registered User
    Join Date
    03-26-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Sum values in one column when values in another column are greater than zero

    Thanks Matt. I know I can use the SUMIF function to get the total of Column G where the values in Column E are > 0.

    For example, using =SUMIF(E5:E9,">0",G5:G9) will return 25 in my Result Table in Column1/Row3.

    What I am unsure of is how do I alter this formula to get the correct sum in each unique intersection in my Result Table when I copy it across and down?

  6. #6
    Registered User
    Join Date
    03-15-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Sum values in one column when values in another column are greater than zero

    You will have to create a separate column like I did to tabulate the total and then reference that in your needed cell.

    To be honest, your column and Row names make it very difficult to understand what you are trying to accomplish. I would help more but am not entirely sure what you are trying to accomplish.

    Could you load some actual data? It may be a good reference to see what is needed.

  7. #7
    Registered User
    Join Date
    03-26-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Sum values in one column when values in another column are greater than zero

    Here's the actual spreadsheet I'm working on. The first tab has the Base Table data and the second tab has the Result table. I entered the SUMIF formulas in the first few cells that give me what I want to achieve, but I'm not sure how to modify them to be able to copy them down and across to fill out the Result Table.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-15-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Sum values in one column when values in another column are greater than zero

    Dogs and Cats.xlsxYou have columns and rows with multiple uses of the same name/heading. This makes it difficult for Excel and myself to decipher what is what.
    I have renamed the headings. Please tell me what the result table is calculating

  9. #9
    Registered User
    Join Date
    03-26-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Sum values in one column when values in another column are greater than zero

    Sorry for the confusion. I attached a new example spreadsheet with notes in the second tab as to what I am trying to accomplish. I hope this is more clear.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    03-15-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    36

    Re: Sum values in one column when values in another column are greater than zero

    I spent about an hour on this and am still working. I found a solution for part of this but my solution is extremely tedious. I am looking for a more user friendly result

  11. #11
    Registered User
    Join Date
    03-26-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Sum values in one column when values in another column are greater than zero

    Very much appreciate your help. I just discovered the INDIRECT function (I've never used it). But I think it may help here since it seems to allow you to use contents of one cell as part of a cell reference in a formula. I'm just not sure how exactly it would work within a SUMIF function.

  12. #12
    Registered User
    Join Date
    03-26-2010
    Location
    Reading, PA
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Sum values in one column when values in another column are greater than zero

    Figured this out using INDIRECT function. Still not 100% sure I needed to use that function for this, but it worked. Revised spreadsheet is attached. Thanks to those that helped.
    Attached Files Attached Files

+ 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. [SOLVED] list all cells in a row with values greater than zero by column header and value
    By tomaszevsky in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-23-2021, 11:37 AM
  2. Replies: 2
    Last Post: 12-30-2013, 08:15 AM
  3. Counting values greater than or equal to those in another column
    By andyr85 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2010, 04:15 PM
  4. [SOLVED] How do I search an array for values in a column greater than zero
    By letsagmj in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-25-2006, 09:45 PM
  5. [SOLVED] Advanced Filter for Values in Column M greater than Values in Colu
    By SteveC in forum Excel General
    Replies: 3
    Last Post: 05-02-2006, 03:00 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