Find unique value and sum results.

joelnichols

Active Member
Joined
Apr 13, 2004
Messages
406
Office Version
  1. 2003 or older
Platform
  1. Windows
Brief history. Left job about 15 years ago where I used Excel a little. Back to using it now but forgot almost everything I knew (ugh). So forgive the simple problems please :). I.E , cant figure out how to post my sheet or download the add-in. So my question is, Col A has names (listed multiple times), B has amount used. I want to look for name and sum the amount used. Whats the best (easiest)way to do that? Also need to exclude the header from the list.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Excel Formula:
=SUMIF(ColA,name,ColB)

so if the name your summarizing is in cell C2, and your columns go to row 100, starting at row 2, in cell D2 you could put:
Excel Formula:
=SUMIF($A$2:$A$100,C2,$B$2:$B$100)
 
Upvote 0
Excel Formula:
=SUMIF(ColA,name,ColB)

so if the name your summarizing is in cell C2, and your columns go to row 100, starting at row 2, in cell D2 you could put:
Excel Formula:
=SUMIF($A$2:$A$100,C2,$B$2:$B$100)[
[/QUOTE]
Perfect, but I got ahead of myself on that. How would I get the names for Col A from a different sheet and have it list in alphabetical order? Or should I do a new post for that question?
 
Upvote 0
If this is a one time thing, just copy and paste. Then use the AutoFilter tool and then sort.

But, that should not make any difference, SUMIF does not require sorted data.

If it is a recurring thing, then you can record a macro, then edit it to be more ubiquitous.

Later versions of EXCEL have a SORT Function that would make this very easy.

If you do need to have formula or macro for the sorting then I suggest making another post. But make it clear so it seems to be an entirely different question.

And with what you're asking both workbooks need to be open when doing the data grab, and you'd probably need to convert to values each time so you don't have to worry about the 2nd workbook always needing to be open. But that opens another can of worms with data becoming stale, etc.
 
Upvote 0
If this is a one time thing, just copy and paste. Then use the AutoFilter tool and then sort.

But, that should not make any difference, SUMIF does not require sorted data.

If it is a recurring thing, then you can record a macro, then edit it to be more ubiquitous.

Later versions of EXCEL have a SORT Function that would make this very easy.

If you do need to have formula or macro for the sorting then I suggest making another post. But make it clear so it seems to be an entirely different question.

And with what you're asking both workbooks need to be open when doing the data grab, and you'd probably need to convert to values each time so you don't have to worry about the 2nd workbook always needing to be open. But that opens another can of worms with data becoming stale, etc.
Its all 1 book. Importing data daily or weekly to sheet 3 and it may have same name multiple times. Trying to get all unique names to sheet 1 ColA in alphabetical order and add the corresponding values to ColB.
 
Upvote 0
Okay, only 1 workbook is helpful. But, still you need to record a macro.
Start Recording Macro.
Goto Sheet 3, select column A
Goto Sheet 1 select cell A1
Paste
Select Column A
right click
click Sort
Stop Recording Macro.

If sort isn't in the ALT-MENU then use the sort tool in the DATA ribbon.
 
Upvote 0
Went with Index, match
Yet you have marked post #6, which does not mention index/match as the solution? :confused:

Could you explain how you used index match to achieve your result as it might help future readers?


Trying to get all unique names to sheet 1 ColA in alphabetical order and add the corresponding values to ColB.
If you create a Pivot Table from the original data it will automatically give a sorted list of unique names and the totals for each name. At least it did for me.

joelnichols.xlsm
AB
1NameAmount
2Ann6
3Bill2
4Sam5
5Sam3
6Bill2
7Jen1
8Jen5
9Ann4
10Sam2
11Ken3
12Eva4
13Bill5
Sheet2



joelnichols.xlsm
AB
1Row LabelsSum of Amount
2Ann10
3Bill9
4Eva4
5Jen6
6Ken3
7Sam10
8Grand Total42
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,139
Messages
6,123,262
Members
449,093
Latest member
Vincent Khandagale

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