+ Reply to Thread
Results 1 to 6 of 6

Sum values if other cels in that row are matching

  1. #1
    Registered User
    Join Date
    01-03-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    3

    Sum values if other cels in that row are matching

    Can anybody help me? I like to have in just one cell a formula that sum's the values of a that particular cel if in that row 3 other cells are valid

    Date Value Name type
    1-1-2013 43 Delta ZCF2AD2-0584
    2-1-2014 45 Liander ZCF2AD2-0584
    3-2-2013 3 Stedin ZCF2AD2-0584
    4-3-2013 86 Westland ZCF2AD2-0584
    5-5-2014 5 Enexis ZCF2AD2-0584
    6-1-2014 556 Delta ZCF2AD2-0584
    7-9-2013 34 Liander ZCF2AD2-0584
    8-10-2013 8 Stedin ZCF2AD2-0585


    So i need a total of the "value" column, if the month is 1, the year is 2014, the name is "Delta" and the type is "ZCF2AD2-0584" In this example the result has to be 599

  2. #2
    Registered User
    Join Date
    01-03-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Sum values if other cels in that row are matching

    Herewith a better view of the rows and columnsCapture.JPG

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Sum values if other cels in that row are matching

    Hi and welcome to the forum

    This is 1 way....
    =SUMIFS($B$2:$B$9,$C$2:$C$9,"delta",$D$2:$D$9,"ZCF2AD2-0584",$A$2:$A$9,">=1/1/2014",$A$2:$A$9,"<=12/31/2014")

    Another way would be to put each criteria in its own cell, and then reference that cell...
    F
    1
    delta
    2
    ZCF2AD2-0584
    3
    1/1/2014
    4
    12/31/2014
    5
    6
    556

    F6=SUMIFS($B$2:$B$9,$C$2:$C$9,$F$1,$D$2:$D$9,$F$2,$A$2:$A$9,">"&F3,$A$2:$A$9,"<="&F4)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Sum values if other cels in that row are matching

    welcome to the forum, edsabel. why is it 599?
    if the month is 1, the year is 2014
    i suppose you are referring to 2 of these rows:
    1-1-2013 43 Delta ZCF2AD2-0584
    6-1-2014 556 Delta ZCF2AD2-0584

    but the first one is 2013. Ford's first formula might not work for you if your Date Region Settings is in Dutch settings of DMY. his 2nd one will work for you as long as the dates you typed in F3 & F4 are as per your settings. so if the above is a typo & the first one is also 2014, then:
    =SUMIFS(B:B,C:C,"delta",D:D,"ZCF2AD2-0584",A:A,">=1jan2014",A:A,"<=31jan2014")

    if you want ALL month 1 & disregard the year, then:
    =SUMPRODUCT($B$2:$B$9*($C$2:$C$9="delta")*($D$2:$D$9="ZCF2AD2-0584")*(MONTH($A$2:$A$9)=1))

    also remember to change all our commas to semi-colons if you receive a prompt that our formulas has errors

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  5. #5
    Registered User
    Join Date
    01-03-2014
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Sum values if other cels in that row are matching

    Hi benishiryo,

    Your formula below works excelent. I only added the year also based on your exanple.

    =SUMPRODUCT($B$2:$B$9*($C$2:$C$9="delta")*($D$2:$D$9="ZCF2AD2-0584")*(MONTH($A$2:$A$9)=1)*(YEAR($A$2:$A$9)=2013))

    Many many thanks for your help

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

    Re: Sum values if other cels in that row are matching

    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. [SOLVED] Return cell values for non-matching & matching criteria
    By jenz_skallemose in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 11-13-2012, 11:52 AM
  2. Bring values in different cels in to a single cell
    By pillari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2012, 09:20 AM
  3. Replies: 8
    Last Post: 07-28-2012, 03:22 PM
  4. protecting cels based on its values possible?
    By chrisumali in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-22-2009, 12:35 AM
  5. Autofill cels based on two dates in adjacent cels
    By William2 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-01-2006, 06:57 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