+ Reply to Thread
Results 1 to 11 of 11

Summing column based on certain criteria

  1. #1
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Summing column based on certain criteria

    Hello,

    I am trying to use a formula that will sum up a column based on certain criteria. I want to sum up column C if the location (column A) is New York and the colors are (column B) Red or Blue.

    I attached my work in this thread with the formula that I used, but it does not work.

    Any help with this is much appreciated!
    Attached Files Attached Files

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Summing column based on certain criteria

    Possibly you may have to add the SumIfs() together?

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Somebody may possibly have an elegant way with one formula...

  3. #3
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,420

    Re: Summing column based on certain criteria

    Or this:

    =SUMPRODUCT((A2:A12="New York")*((B2:B12="Red")+(B2:B12="Blue"))*C2:C12)
    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.

  4. #4
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Summing column based on certain criteria

    With a pivot table.

    See the 2 examples in the attached file.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  5. #5
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Summing column based on certain criteria

    I actually figured out another way as well!!

    =SUM(SUMIFS($C$2:$C$12,$A$2:$A$12,"=New York",$B$2:$B$12,{"Red","Blue"}))

    Thank you all for your responses!!

    I actually have another question. How would I do the opposite if I want to sum up the amount with the criteria being New York and the colors cannot be Red or Blue? I don't want to say that the color column is equal to green; I would want it to say <> Red or Blue.

    Any help with this is appreciated!!

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,485

    Re: Summing column based on certain criteria

    I had tried this your formula as well, I was not getting the correct result.
    Edit: I forgot about it not equaling "New York"

  7. #7
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Summing column based on certain criteria

    Quote Originally Posted by davesexcel View Post
    I had tried this your formula as well, I was not getting the correct result
    I got the right result with the formula I tried. I attached my Excel workbook again so you can test it out!
    Attached Files Attached Files

  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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,420

    Re: Summing column based on certain criteria

    Try:

    =SUMIFS($C$2:$C$12,$A$2:$A$12,"New York",$B$2:$B$12,"<>Red",$B$2:$B$12,"<>Blue")

  9. #9
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Summing column based on certain criteria

    Quote Originally Posted by AliGW View Post
    Try:

    =SUMIFS($C$2:$C$12,$A$2:$A$12,"New York",$B$2:$B$12,"<>Red",$B$2:$B$12,"<>Blue")
    That works perfectly! Thank you so much!

  10. #10
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Summing column based on certain criteria

    @KoolKatelyn

    Did you also looked ad my pivot table solution in #4?

  11. #11
    Registered User
    Join Date
    06-30-2016
    Location
    Oaks, PA
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: Summing column based on certain criteria

    Quote Originally Posted by oeldere View Post
    @KoolKatelyn

    Did you also looked ad my pivot table solution in #4?
    Yes, I saw your pivot table solution which works as well! Thank you for your help!

+ 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] Consolidate row data based on 2 criteria and summing one column.
    By mlski4751 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2017, 03:06 PM
  2. [SOLVED] Summing row ranges based on non-sequential column criteria
    By TexasKersh in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-20-2014, 08:21 AM
  3. Summing Values in column based upon multiple criteria
    By shantanuk in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-21-2012, 09:29 AM
  4. Replies: 3
    Last Post: 09-27-2011, 01:37 PM
  5. Replies: 9
    Last Post: 06-29-2009, 01:14 AM
  6. Summing rows based on criteria in another column
    By reybie in forum Excel General
    Replies: 2
    Last Post: 07-11-2006, 02:15 PM
  7. Counting & Summing based on criteria on another column
    By Chicago D in forum Excel General
    Replies: 2
    Last Post: 08-25-2005, 02:05 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