How to match names and add totals?

Nikkiho

New Member
Joined
Jan 2, 2021
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
Hi, Im sure this is a really simple solution but I can't figure it out.

I have a spreadsheet that looks like this

Column A Column B Column C Column E Column F Column G
Name # of in # of Out Name Total in Total out
Mary 1 1
John 2 1
Kathy 1 5
Mary 2 4

What I want is in Column E I want it to take the name from Column A but as you can see Mary appears twice. I only want her to appear once in column E. Then in Column F I want the total "in" so in this case Column E would say Mary, Column F would have 3 and Column G would have 5 (which is the total of all the in's and outs Mary has had)

Does that make sense?

Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
you could use a pivot table to do that

Book1
ABCDEFG
1Name # of in# of OutRow LabelsSum of # of inSum of # of Out
2Mary11John21
3John21Kathy15
4Kathy15Mary35
5Mary24Grand Total611
6
Sheet1
 
Upvote 0
Or vba
VBA Code:
Sub t()
Dim c As Range
Range("A1", Cells(Rows.Count, 1).End(xlUp)).AdvancedFilter xlFilterCopy, , Range("E1"), True
    For Each c In Range("E2", Cells(Rows.Count, 5).End(xlUp))
        c.Offset(, 1) = Application.SumIf(Range("A:A"), c.Value, Range("B:B"))
        c.Offset(, 2) = Application.SumIf(Range("A:A"), c.Value, Range("C:C"))
    Next    
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,458
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top