+ Reply to Thread
Results 1 to 19 of 19

sum if rows contain same data

  1. #1
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    sum if rows contain same data

    Hi,

    I have a table of data that has 800+ entries. A lot of the entries have the same information in the first 3 columns but the fourth column (D), showing hours, has a different number than the last.
    I need a formula to add up the hours if the data in the first 3 columns is exactly the same. If one of the column's data is different then it needs to remain as an independant entry.

    If it would be possible to automatically show the formulated data like I have done in my example table then this would be a bonus!

    Thanks,
    Alex
    Attached Files Attached Files
    If this answer helped you then could you please click "Add Reputation"

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,371

    Re: sum if rows contain same data

    Have you looked at SUMIFS, or possibly a Pivot Table?


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: sum if rows contain same data

    HI

    =SUMIFS($D$3:$D$36,$A$3:$A$36,F3,$B$3:$B$36,G3,$C$3:$C$36,H3)

    Punnam

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sum if rows contain same data

    Hi,

    See attached,

    I had originally thought you had added the values in F:H and therefore used the SUMIFS() function you see in I4. Then I realised that this was a classic candidate for a Pivot Table.
    Attached Files Attached Files
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: sum if rows contain same data

    Quote Originally Posted by Punnam View Post
    HI

    =SUMIFS($D$3:$D$36,$A$3:$A$36,F3,$B$3:$B$36,G3,$C$3:$C$36,H3)

    Punnam
    Punnam, that formula requires the data that is in the table that I have typed out manually. This is a much shorter version of the table that Iwant, as it shows only the totals.
    I need to get to that result, so unfortunately I don't have that table at the moment so I can't use your formula.

  6. #6
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: sum if rows contain same data

    Quote Originally Posted by Richard Buttrey View Post
    Hi,

    See attached,

    I had originally thought you had added the values in F:H and therefore used the SUMIFS() function you see in I4. Then I realised that this was a classic candidate for a Pivot Table.
    Hi Richard, this is really what I need but I'm not sure how to get the pivot table to display like this...as I can only get it to list everything below each other.

    Could you please explain?

    thanks!

  7. #7
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sum if rows contain same data

    By default when you create a pivot table you get the 'new look'. i.e. New since Excel 2007. Not only does this list the field values in a single column it also defaults to adding a Sub total value for each field.

    I think you're looking for the old 'Classic View' In which case right click anywhere in the PT and select Pivot Table Options...Display tab and select the 'Classic' PT.
    You might also want to right click in a field and remove the tick on the 'Subtotal...field name'. Depends exactly what you want to see.

  8. #8
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: sum if rows contain same data

    That's exactly what I was looking for, thank you very much.
    I've been using Pivot Tables since February and never knew you could display the data like that!
    They do make life a lot easier when you know how to use them.
    Thanks again Richard!

  9. #9
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: sum if rows contain same data

    Hi,

    Glad to have helped and thanks for the rep.

  10. #10
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Thumbs up Re: sum if rows contain same data

    Hi bro,
    got the solution..
    check the attachment


    Click * to appreciate
    Attached Files Attached Files

  11. #11
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: sum if rows contain same data

    liked the solution or not...?

  12. #12
    Forum Contributor
    Join Date
    08-22-2013
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    157

    Re: sum if rows contain same data

    Quote Originally Posted by Vikas_Gautam View Post
    Hi bro,
    got the solution..
    check the attachment


    Click * to appreciate
    Hi Vikas,
    Thanks for your reply but this also uses my example table which I have only mocked up to explain what I wanted. I won't have this information for the rest of the data...as that is what I am trying to get.

  13. #13
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: sum if rows contain same data

    Quote Originally Posted by alexander.small View Post
    Hi Richard, this is really what I need but I'm not sure how to get the pivot table to display like this...as I can only get it to list everything below each other.

    Could you please explain?

    thanks!
    Hi,

    I have attached u the updated sheet for u r reference .


    Punnam
    Attached Files Attached Files

  14. #14
    Forum Contributor
    Join Date
    07-10-2012
    Location
    Bangladesh
    MS-Off Ver
    Excel 2007
    Posts
    129

    Re: sum if rows contain same data

    boss use =+SUMPRODUCT(($B$3:$B$36=$G3)*($C$3:$C$36=$H3)*($D$3:$D$36))

  15. #15
    Registered User
    Join Date
    06-27-2014
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    15

    Re: sum if rows contain same data

    Can someone please explain me what is the purpose of putting "+" sign after "=" in a formula. I have seen many people using this but not get the approp answer yet.

    Regards,
    Rupesh

  16. #16
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,289

    Re: sum if rows contain same data

    The + - sign was needed at the Lotus 123 program, but unnecessary in Excel
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  17. #17
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: sum if rows contain same data

    oh man...
    we usually start the formula using = and sometime..
    we use + to start the formula...
    when we use + then excel automatically puts a = sign before the plus sign..

    click * to appreciate...

  18. #18
    Registered User
    Join Date
    06-27-2014
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    15

    Re: sum if rows contain same data

    Thank you Willem and Vikas for the answer. so there is no any special reason for putting this, both are same.

    Rupesh

  19. #19
    Forum Contributor
    Join Date
    10-19-2012
    Location
    chennai
    MS-Off Ver
    Excel 2013
    Posts
    134

    Re: sum if rows contain same data

    Hi Rupeshpatil,

    Its a typo error and the formula is =SUMPRODUCT(($B$3:$B$36=$G3)*($C$3:$C$36=$H3)*($D$3:$D$36))

    Try this.

+ 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: 4
    Last Post: 11-13-2013, 11:15 AM
  2. Replies: 1
    Last Post: 08-24-2013, 07:01 AM
  3. [SOLVED] Delete blank rows between data rows, shift rows up, then repeat
    By excelactuary in forum Excel General
    Replies: 2
    Last Post: 03-11-2013, 11:53 AM
  4. Replies: 6
    Last Post: 08-18-2012, 05:00 AM
  5. data rows to data columns and rows in sequence
    By Butehawk in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-24-2010, 08:11 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