Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old September 12th 12, 07:47 PM
Junior Member
 
First recorded activity by ExcelBanter: Sep 2012
Posts: 5
Smile 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

Last edited by jaccobby : September 12th 12 at 07:53 PM Reason: forgot to mention thanks

  #2   Report Post  
Old September 12th 12, 08:05 PM
Senior Member
 
First recorded activity by ExcelBanter: Mar 2012
Posts: 663
Default

Quote:
Originally Posted by jaccobby View Post
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...
  #3   Report Post  
Old September 13th 12, 08:52 PM
Junior Member
 
First recorded activity by ExcelBanter: Sep 2012
Posts: 5
Default

Quote:
Originally Posted by Spencer101 View Post
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

Last edited by jaccobby : September 13th 12 at 09:00 PM
  #4   Report Post  
Old September 13th 12, 09:10 PM
Senior Member
 
First recorded activity by ExcelBanter: Mar 2012
Posts: 663
Default

Quote:
Originally Posted by jaccobby View Post
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.
  #5   Report Post  
Old September 14th 12, 07:28 PM
Junior Member
 
First recorded activity by ExcelBanter: Sep 2012
Posts: 5
Default

Quote:
Originally Posted by Spencer101 View Post
Can you not use a pivot table to do this?

not exactly what I had in mind but thanks anyway


  #6   Report Post  
Old September 14th 12, 08:47 PM posted to microsoft.public.excel.newusers
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2011
Posts: 3,685
Default 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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to look up values in 2 different columns anshu minocha Excel Programming 3 January 29th 10 06:04 PM
Associate values in worksheet?? Jon M Excel Worksheet Functions 1 July 4th 08 03:28 PM
Macro to copy and paste values (columns)I have a macro file built C02C04 Excel Programming 2 May 2nd 08 01:51 PM
How to create button and associate a macro with it. Nils Titley Excel Programming 4 March 20th 08 02:50 PM
Associate additional columns with an external query cujimm Excel Programming 0 December 9th 05 12:30 AM


All times are GMT +1. The time now is 01:27 PM.

Powered by vBulletin® Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017