ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   I need a macro to associate values in columns (https://www.excelbanter.com/new-users-excel/447104-i-need-macro-associate-values-columns.html)

jaccobby

I need a macro to associate values in columns
 
I have a list of names in the first column which can contain one or more of the same name, and a list of numbers associated with each name in column 2 . what i want to do is search through the names and add the corresponding numbers, so as I end up with a column with names which are not duplicated and a column with the the sum of numbers associated with each name thanks

Spencer101

Quote:

Originally Posted by jaccobby (Post 1605435)
I have a list of names in the first column which can contain one or more of the same name, and a list of numbers associated with each name in column 2 . what i want to do is search through the names and add the corresponding numbers, so as I end up with a column with names which are not duplicated and a column with the the sum of numbers associated with each name thanks

Any chance of an example workbook? Always a great starting point for help...

jaccobby

Quote:

Originally Posted by Spencer101 (Post 1605436)
Any chance of an example workbook? Always a great starting point for help...

what I want is
Names values Names values
name1 256 name1 1690
name2 148 name2 513
name1 268 name3 2237
name3 967
name3 685
name1 598
name2 365
name1 568
name3 585

Spencer101

Quote:

Originally Posted by jaccobby (Post 1605477)
what I want is
Names values Names values
name1 256 name1 1690
name2 148 name2 513
name1 268 name3 2237
name3 967
name3 685
name1 598
name2 365
name1 568
name3 585

Can you not use a pivot table to do this?

It's easy enough to do with formulas, SUMIF or SUMPRODUCT will do it depending on which version of Excel you use. But they will both depend on you having a unique list of names to begin with.

I don't know a macro would be necessary.

jaccobby

Quote:

Originally Posted by Spencer101 (Post 1605480)
Can you not use a pivot table to do this?


not exactly what I had in mind but thanks anyway

Claus Busch

I need a macro to associate values in columns
 
Hi,

Am Fri, 14 Sep 2012 18:28:20 +0000 schrieb jaccobby:

not exactly what I had in mind but thanks anyway


filter the names with advanced filter without duplicates to Column G
e.g. Then in H2:
=SUMIF($A$2:$A$100,G2,$B$2:$B$100)
and copy down


Regards
Claus Busch
--
Win XP PRof SP2 / Vista Ultimate SP2
Office 2003 SP2 /2007 Ultimate SP2


All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com