Can anyone tell me if there is a way to sum one range of values depending on the contents of another range?
For example, lets say my spreadsheet has 4 columns:
-Column A has the name of the customer/company.
-Column B has the account numbers.
-Column C has each account's usage.
-Column D has usage totals (this is where I need help)
Companies/Customers often have more than one account and I need the sum of all the usages for accounts belonging to the same customer. Repeat customer names are always listed consecutively, ie if John has 5 accounts, A1:A5 will say "John".
Account numbers are each unique.
So... if A1:A5 says "John", I would like each cell in range D1:D5 to show the sum of C1:C5.
I know how to do all of this with defined criteria, ie if it were only three repeating customers... But we have an infinite number of customers and I need excel to group one range based on grouped values in another. In other words, if, a1:a5 contains "John" and a6:a8 contains "Bob", I want for it to sum only the John accounts together and then the Bob accounts together. Does that make sense?
If anyone could help, I would be infinitely grateful!! (I'm not so familiar with VBA and would of course prefer an Excel formula, but if there is a very SIMPLE VBA solution I can probably do it.)
Thanks!!
Bookmarks