+ Reply to Thread
Results 1 to 10 of 10

Sum exclude duplicates if below each other

  1. #1
    Registered User
    Join Date
    08-02-2014
    Location
    london
    MS-Off Ver
    2011 mac
    Posts
    6

    Sum exclude duplicates if below each other

    I'm trying to work out the follow. I need to write a formula that sums ups the amounts in a column, however these amounts are grouped, the last one in a group should not be taken into account as this is the sum of the group. The other way around could also work, by just summing up the sums of each of the grouped amounts.

    A
    15.00
    5.00
    20.00

    179.00
    179.00

    178.00
    178.00

    Sum Should be 20+179+178 or 15+5+179+178.

    Anyone has a best approach for this?

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

    Re: Sum exclude duplicates if below each other

    b2 =
    Please Login or Register  to view this content.
    and drag down


    d2=
    Please Login or Register  to view this content.
    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.

  3. #3
    Registered User
    Join Date
    08-02-2014
    Location
    london
    MS-Off Ver
    2011 mac
    Posts
    6

    Re: Sum exclude duplicates if below each other

    Thanks that works. But would there be a cleaner solution for this?

    As I would need to work with new data on this every day. Ideally I'd like to have a formula in one cell at the bottom of the sheet, without needing to manipulate the sheet of data every time around.

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Sum exclude duplicates if below each other

    Try this.......

    Assuming you have numbers in the range A2:A10 with one blank row below each sum for a group(as shown in the example data), then try this Array Formula which requires confirmation with special key strokes Ctrl+Shift+Enter instead of just Enter. If you enter an array formula correctly, you will notice in the formula bar that the formula gets surrounded by the curly brackets and if you don't see the curly brackets in the formula bar, press F2 (function key), hold down the Ctrl+Shift together and then press Enter to confirm it as an array formula.

    Please Login or Register  to view this content.
    Does this help?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Registered User
    Join Date
    08-02-2014
    Location
    london
    MS-Off Ver
    2011 mac
    Posts
    6

    Re: Sum exclude duplicates if below each other

    Hi Sktneer,

    Thanks for this. I can see what you are doing with this formula, but it doesn't work for some reason, as it returns the { do appear }.

    I'm using this:
    {=SUM(IF(H2:H62="",H2:H61))}

    It is not returning any errors, expect the reference to empty cells.

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Sum exclude duplicates if below each other

    In the formula
    Please Login or Register  to view this content.
    you have to pay attention to the cell references in red.
    Where A1= the cell just above your first number and A11=the cell below the last sum of a group, assuming your numbers are in the range A2:A10.

    Change it as per your need and if this doesn't work, it would be better if you upload a sample workbook.
    See the attached sheet where the formula is applied for the example data in post#1.
    Attached Files Attached Files

  7. #7
    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 exclude duplicates if below each other

    Try...

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


    Don't forget to click *

  8. #8
    Registered User
    Join Date
    08-02-2014
    Location
    london
    MS-Off Ver
    2011 mac
    Posts
    6

    Re: Sum exclude duplicates if below each other

    Thanks got it to work!

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Sum exclude duplicates if below each other

    Glad to know that. Thanks for the feedback.
    If that takes care of your question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.
    Moreover you may also click on * (star) to Add Reputation to those who have put their time and efforts to help you in this forum. This is another way to say thanks to them.

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Sum exclude duplicates if below each other

    Maybe this one too

    =SUM(A2:A10)/2

    Sometimes the very obvious is very difficult to see. Here is an example of it. Each group has the last cell that totals the amount of each group which in fact doubles the amount of all cells. Therefore sum of all cell divided by 2 will get you there result.
    Last edited by AlKey; 08-03-2014 at 10:47 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

+ 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: 09-11-2013, 05:58 PM
  2. SUMIFS and exclude Duplicates with a table reference
    By GOQC in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-06-2013, 01:24 PM
  3. Replies: 5
    Last Post: 08-29-2012, 11:35 AM
  4. Sum column exclude duplicates
    By ryan@csi in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 11-18-2009, 02:40 PM
  5. [SOLVED] Count 350 SS numbers, exclude duplicates
    By Marsha in forum Excel General
    Replies: 5
    Last Post: 03-07-2005, 02:06 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