+ Reply to Thread
Results 1 to 7 of 7

Need Help Summing Multiple Columns Based On Certain Criteria

  1. #1
    Registered User
    Join Date
    12-13-2013
    Location
    Wayland, MI
    MS-Off Ver
    Excel 2003
    Posts
    3

    Need Help Summing Multiple Columns Based On Certain Criteria

    I need help with a formula for summing the total lines an employee typed for a given department. Please see attached spreadsheet.
    Since I will be adding and deleting employees throughout the year, I need the formula to sum the lines based on the employee ID and not a static line.
    Example: For Julie, I need to formula to search down Column A for ID#1002, and then sum all the "Blue" lines, all the "Red" lines, and all the "Green" lines she typed.
    I tried using sumproduct but could not figure it out. If it matters, I am putting the formula into a different workbook that will reference back to this one.
    Any help would be much appreciated.

    Thanks!

    Andre
    Attached Files Attached Files
    Last edited by aleboeuf; 12-13-2013 at 06:56 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Need Help Summing Multiple Columns Based On Certain Criteria

    You should be able to use something like:

    =SUMPRODUCT(($A$3:$A$13=1001)*($D$3:$Q$13))

    Adjust your ranges to encompass all of your data, of course. You may also want to have a unique list of all ID's in one column (e.g. A1:A20), then in the next column use this formula and replace 1001 with B1 and fill down. That way you don't have to specify an individual ID in each formula.

  3. #3
    Registered User
    Join Date
    12-13-2013
    Location
    Wayland, MI
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need Help Summing Multiple Columns Based On Certain Criteria

    Thank you Paul for the help! However, this gives me the total lines that the employee typed. I actually need to know how man "Blue" lines she typed AND how many "Red" lines she typed AND how many "Green" lines she typed. I need to be able to break her total line count down by department color. Thanks again!

  4. #4
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Need Help Summing Multiple Columns Based On Certain Criteria

    Hello Andre

    If ID# are not repeating in column A, you could use SUMIF

    =SUMIF(D2:AW2,"Blue",INDEX(D3:AW13,MATCH(ID_NUmber,A3:A13,0),0))

    Or SUMPRODUCT, If ID repeating or not,

    =SUMPRODUCT((D2:AW2="Blue")*(A3:A13=ID_NUmber),D3:AW13)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Need Help Summing Multiple Columns Based On Certain Criteria

    How about:

    =SUMPRODUCT(($A$3:$A$13=$C19)*(($D$3:$Q$13)*($D$2:$Q$2=D$18)))

    See attached worksheet for how the summary data is laid out.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-13-2013
    Location
    Wayland, MI
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need Help Summing Multiple Columns Based On Certain Criteria

    Thank you Hasseb and Paul. I appreciate your help! Both of your solutions work perfectly.

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Need Help Summing Multiple Columns Based On Certain Criteria

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Replies: 7
    Last Post: 02-03-2013, 06:25 PM
  2. Replies: 16
    Last Post: 10-19-2012, 08:48 PM
  3. [SOLVED] index formula needed--how to get a formula to skip columns
    By rsmidtisu in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 10-02-2012, 11:22 AM
  4. [SOLVED] Formula needed!
    By Ledisita in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-23-2012, 12:35 PM
  5. Replies: 3
    Last Post: 09-07-2012, 12:07 AM

Tags for this Thread

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