+ Reply to Thread
Results 1 to 6 of 6

sum on several conditions

  1. #1
    Registered User
    Join Date
    09-15-2010
    Location
    Hull, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    sum on several conditions

    Hi,
    I need a formula that would sum the numbers if firm_id, date, type and man_id are the same.

    I need the sum to appear on the last record of the same firm_id/date/type and man_id.
    Please find an example attached. The columns marked in red colour represent the ones that I need to be generated by a formula.

    Thanks,
    Attached Files Attached Files
    Last edited by AGA; 03-20-2012 at 03:23 PM. Reason: solved

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: sum on several conditions

    Hi

    Try.

    =SUMPRODUCT((($A$2:$A$13=A2)*($B$2:$B$13=B2)*($C$2:$C$13=C2)*($D$2:$D$13=D2)*($E$2:$E$13)))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: sum on several conditions

    i dont understand the requirements, for example cell G9 is totaling E9+E8+E7, but they all have different IDs and Dates.

    can you please clarify the requirement?
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  4. #4
    Registered User
    Join Date
    09-15-2010
    Location
    Hull, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: sum on several conditions

    Quote Originally Posted by Fotis1991 View Post
    Hi

    Try.

    =SUMPRODUCT((($A$2:$A$13=A2)*($B$2:$B$13=B2)*($C$2:$C$13=C2)*($D$2:$D$13=D2)*($E$2:$E$13)))

    Hi, Thanks for this, but it does not give me what I need.
    I need two columns to be populated with numbers (F,G on the example spread sheet).
    Also I would like the rows, that are not the last records of a patricular man_id/date/firm/type to be empty or equal zero.


    Thanks,

  5. #5
    Registered User
    Join Date
    09-15-2010
    Location
    Hull, England
    MS-Off Ver
    Excel 2007
    Posts
    51

    Re: sum on several conditions

    Quote Originally Posted by DGagnon View Post
    i dont understand the requirements, for example cell G9 is totaling E9+E8+E7, but they all have different IDs and Dates.

    can you please clarify the requirement?
    I apologise for this.
    I uploaded a file with corrections.
    Could you have another look?
    Thank you.

  6. #6
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: sum on several conditions

    Thank you for the update,

    In column F use this

    =IF(COUNTIFS(A$1:A2,A2,B$1:B2,B2,C$1:C2,C2,D$1:D2,D2)=COUNTIFS(A:A,A2,B:B,B2,C:C,C2,D:D,D2),1,0)

    in column G use this

    =IF(F2=1,SUMIFS(E$1:E2,A$1:A2,A2,B$1:B2,B2,C$1:C2,C2,D$1:D2,D2),"")

    see attached file for details.
    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)

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