Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 9th, 2008, 09:47 AM
Registered User
 
Join Date: Jan 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default sum group values based on cell criteria

Hi,

 I have an Excel spreadsheet in the format below. I'd like to write a formula that can calculate the trader commission total, as well as the broker commission within each trader. Essentially, it'll add the commission columns for each value relating to trader1 to give an accumulative. It will also add the commission totals for lloyds & hsbc for trader 1.

 Then do this for the rest of the traders.
Any ideas on how to do this much appreciated.

Thanks

broker commission Trader

lloyds 3,432 trader1
lloyds 5,433 trader1
lloyds 21,231 trader1
hsbc 4,204 trader1
hsbc 16,884 trader1
hsbc 43,343 trader1
hsbc 4,563 trader1
hsbc 10,000 trader1
abbey 5,500 trader1
abbey 2,323 trader2
abbey 324,234 trader2
lloyds 5,169 trader2
lloyds 544 trader2
lloyds 5,169 trader2
hsbc 5,169 trader2
hsbc 34,343 trader2
hsbc 5,500 trader2
hsbc 5,169 trader2
hsbc 10,000 trader2
abbey 5,500 trader2
abbey 11,550 trader2
abbey 34,343 trader 3
lloyds 10,000 trader 3
lloyds 10,000 trader 3
lloyds 34,343 trader 3
hsbc 10,000 trader 3
hsbc 34,343 trader 3
northern rock 10,000 trader 3
northern rock 34,343 trader 3


 
Old January 9th, 2008, 09:13 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

You can try SUMIF's

=SUMIF(A1:A30,"hsbc",B1:B30)
=SUMIF(C1:C30,"trader1",B1:B30)

for individual and can combine them to form the subtotals




http://www.dotnetdud.blogspot.com

VBA Tips & Tricks (http://www.vbadud.blogspot.com)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I in SQL group by week & sum the values (i.e. callagga SQL Language 2 May 16th, 2008 07:25 AM
copy columns based on cell values EricB123 Excel VBA 0 December 18th, 2007 12:51 AM
SUM and GROUP BY in vba wdepreter Excel VBA 3 February 5th, 2007 06:11 AM
Group by , Sub Group by and Sum mateenmohd SQL Server 2000 1 March 29th, 2005 09:51 AM
Sum up columns with different criteria pontitt2 SQL Language 5 May 11th, 2004 02:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.