grouping values matching criteri
Microsoft Office TrainingThe UK's Number 1 for Microsoft Office Training Sitemap add this page to your favourites/bookmarksBookmark page
 
view a printable version of this pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Grouping of values matching criteria then summing corresponding

Grouping of values matching criteria then summing corresponding

resolvedResolved · High Priority · Version 2003

replyReplyThu 23 Oct 2008, 12:45Delegate Linda said...

Grouping of values matching criteria then summing corresponding

Hi there,

I have a spreadsheet with all my trading data on it. Basically there are three relevant columns I want to collate. Lets call them A (text string), B (text string), and C (value).

I'm trying to write a macro that will look at A & B and if they are the same then sum C, then copy B to new sheet ref and copy C's summed figure to new sheet ref both under new column titled after A's value.

I'm not sure how to ask VBA to group the same values as one entry into new sheet and sum it.

Able to help??

Kind regards
Linda

For upcoming training course dates see: Pricing & availability

replyReplyThu 23 Oct 2008, 18:09Trainer Laura said...

RE: Grouping of values matching criteria then summing correspond

Hi Linda

Thank you for the question.

I'm not totally sure what you mean by grouping.

Do you mean you want totals for every different value in B that has a matching value in A?

Could you upload a simple example showing what you want the VBA to do?

Regards

Laura GB

replyReplyMon 27 Oct 2008, 12:14Delegate Linda said...

RE: Grouping of values matching criteria then summing correspond

Hi Laura,

Here is another way of explaining my query

Trying to write a code to sum up the values in a column providing the two previous column values match up.

EG

AG AAA 123
AG AAA 321
AG CCC 456
AU AAA 252
PT AAA 322
PT AAA 111
PT BBB 333

So I want to grp all the AG&AAA's together (=444) then AG&CCC etc etc)

And I want to paste AAA into a column in new sheet alongside the total sum (444) under a heading for AG.

Hope this helps, I'd really appreciate the advice.

Linda

replyReplyMon 10 Nov 2008, 10:13 Edited on Mon 10 Nov 2008, 10:19Trainer Laura said...

RE: Grouping of values matching criteria then summing correspond

Hi Linda

I am assuming you have already tried a pivot table and that doesn't answer your need.

ANother solution is to combine using DSUM and and using an Analysis Table. You need to create a single case of a Dsum and then the values you are interested in and then use Table from the Data menu. I have created a small file to demonstrate it. Let me know an email address and I will send it to you.

Regards,

Laura GB

replyReplyMon 10 Nov 2008, 12:15Delegate Linda said...

RE: Grouping of values matching criteria then summing correspond

Hi Laura,

Don't worry, I managed to get what I wanted out of pivot table, I didn't think it would format nicely but turned out ok. I think what I was after was an array, still not entirely sure how to do it but will work it out if I need to do it again!

thanks for help
Linda

 

 

Please browse our web site to find out more about
excel training onsite and other Microsoft training courses.

Excel tip:

Adding Rows or Columns in an Excel 2010 Worksheet

If you want to add a row to an Excel spreadsheet, these are the simple steps you should take:

With your mouse, right click on the row header below where you want the new row to be added. Then, click Insert.

Follow exactly the same steps if you want to add a column to an Excel worksheet, right click on the column header, choose Insert and the new column will be inserted to the left of the selected column.

View all Excel hints and tips

forum postHow will we compare where we are now with the baseline schedule?

» Forum post: Baseline


Rate this page:
2.2/5 (213 votes cast)
Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses
Microsoft Certified Partner
Security Seal verified by visa, mastercard securecard

Mini sitemap. These are the main areas of our web site. Full sitemap.

Management training

Professional Skills courses
Project Management Course London
Project Management Courses London
Project Management Training London
Project Management Training
Project Seminar
Project Seminars
Time Management Course London
Time Management London
Time Management Courses London
Time Management Training London
Introduction to Finance course
Assertiveness Skills course
Effective Communications Skills training
Presentation Skills London

Training Formats

Public scheduled courses
On-site training
Closed company courses

Consultancy
Application Development

Blogs

Excel Training
MS Project Training
Microsoft Training Blog

Version differences

Office 2010 vs 2007
MS Project version differences

Training Information

London Computer Training
Computer Training London
Docklands Training Courses
Docklands Training London

Training venues London
Client list
FAQ
Pricing and availability
Course details / Syllabus

Training Articles
Training Information

Microsoft training

Microsoft Office training
& IT Applications

Microsoft Project training
Microsoft Outlook training
Microsoft Powerpoint training
Microsoft Word training
MS Project courses
MS Project training
Outlook courses
PowerPoint courses
PowerPoint training
VBA courses
Word courses
Microsoft.training
(more...)

Excel Training

Excel courses
Excel Training Courses Medway
Autonumber in Excel
Microsoft Excel training
Basic Excel Courses
Basic Excel Course
Basic Excel Training

Interested in MS Access training?

Access courses
Microsoft Access training
Microsoft access courses
Microsoft training access course
Microsoft+access+training
Access courses in london

Training provider

Training providers
IT training companies
IT training providers
Management Training providers
Management Training provider

Event history, feedback results
Events in 2012 · 2011 · 2010 · More

See also

Crystal Reports training