Remove duplicate rows with sum of a column in excel

Anonymous
2014-03-24T21:33:40+00:00

Hello All,

I have an Excel 2013 spreadsheet with multiple columns (just to fit here, I hide rest columns)

I want to remove the duplicates rows by grouping data columns (A,B,C,D,E,F) but summing the values in the G column corresponding to the repeating rows as shown in below image.

Any help is highly appreciated.

Thanks

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Ashish Mathur 101K Reputation points Volunteer Moderator
    2014-04-01T02:08:07+00:00

    Hi,

    Right click on any cell within the Pivot Table and under Pivot Table Options, select Classic Pivot Table Layout under Display.

    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2014-03-26T17:22:11+00:00

    I've made some minor mods to the macro code I supplied earlier.

    Sub mcr_Collect_Unique()

        Dim ws As Worksheet, wsu As Worksheet

        Set ws = ActiveSheet

        Set wsu = Sheets.Add(after:=Sheets(Sheets.Count))

        ws.Cells(1, 1).CurrentRegion.Copy Destination:=wsu.Cells(1, 1)

        With wsu.Cells(1, 1).CurrentRegion

            With .Cells.Resize(.Rows.Count, .Columns.Count)

                .RemoveDuplicates Columns:=Array(1, 4, 5), Header:=xlYes

                Debug.Print Application.Count(wsu.Columns(6))

                With .Cells(2, 6).Resize(Application.Count(wsu.Columns(6)), 1)

                    .FormulaR1C1 = "=SUMIFS('" & ws.Name & "'!C,'" & ws.Name & _

                      "'!C[-5],RC[-5],'" & ws.Name & "'!C[-2],RC[-2],'" & ws.Name & _

                      "'!C[-1],RC[-1])"

                    '.Cells = .Value

                End With

            End With

        End With

    End Sub

    The only issue that concerns me is the level of uniqueness to determine which rows to keep. Currently, only columns A, D & E (e.g. Array(1, 4, 5),) are considered but column J's Ref Number looks like a good candidate for addition.

    0 comments No comments

13 additional answers

Sort by: Most helpful
  1. Ashish Mathur 101K Reputation points Volunteer Moderator
    2014-03-25T23:21:55+00:00

    Hi,

    There is no file there.  Please check.

    0 comments No comments
  2. Anonymous
    2014-03-26T16:48:38+00:00

    Sorry Ashsih. I missed the shared link. Here you go

    Excel File

    0 comments No comments
  3. Ashish Mathur 101K Reputation points Volunteer Moderator
    2014-03-26T23:03:43+00:00

    HI,

    When I created a Pivot Table, this is the result I got

    0 comments No comments