+ Reply to Thread
Results 1 to 7 of 7

Adding values from one column based on a value from another column

  1. #1
    Registered User
    Join Date
    08-10-2012
    Location
    Hartford, CT, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Adding values from one column based on a value from another column

    Hi everyone-

    I am hoping for some help. I have a column of data (AD) that I would like to add, but only if a number (rating) for the data in column C equals a certain value.

    For example, if rows 5, 8, 15, and 30 have a rating of 1, rows 6, 7, 10 and 20 have a rating of 2, and rows 9, 11, 18 and 22 have a rating of 3, how do I add the data for all rows in column AD, but only for the rows that have the rating 1?

    The goal is to be able to show the total of the data for all three ratings as a percentage of the overall total.

    Please let me know if this explanation is confusing or imcomplete, I can try again!

    Any help is greatly appreciated! Thanks so much!

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Adding values from one column based on a value from another column

    Try the sumif function

    =SUMIF(C:C,1,AD)

    Alternatively the criteria of 1 could be in another cell.

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Adding values from one column based on a value from another column

    Hi,
    perhaps
    Please Login or Register  to view this content.
    adapt the ranges to your needs

  4. #4
    Registered User
    Join Date
    08-10-2012
    Location
    Hartford, CT, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Adding values from one column based on a value from another column

    thanks jason and pepe! this is perfect!

    now, I have this same set-up on different worksheets in the same workbook; so, how do I add sheet 1 total data for rating 1 + sheet 2 total data for rating 1 + sheet 3 total data for rating 1? seems like it should be a =sum(sumif, sumif, sumif)? but I can't figure out the right formula to make it work!

    Thanks so much!

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Adding values from one column based on a value from another column

    Exactly how you thought, maybe your sheet references were wrong.

    =sum(sumif(Sheet1!C:C,1,Sheet1!AD:AD),sumif(Sheet2!C:C,1,Sheet2!AD:AD),sumif(Sheet2!C:C,1,Sheet2!AD:AD))

    If your sheet name is numeric or contains spaces then you need to use

    'Sheet 1'! in place of Sheet 1! (notice that there are 2 single inverted commas in the first example).

  6. #6
    Registered User
    Join Date
    08-10-2012
    Location
    Hartford, CT, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Adding values from one column based on a value from another column

    got it! thank you so much for your quick help!!

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Adding values from one column based on a value from another column

    @ agriswold

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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