Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
You don't need a macro to do this; you can make use of formula arrays. Set up a fifth column which is just quantity * price On your summary page type in formulaa similar to (not forgetting to add worksheet references): SUM((A2:A6="name1")*(B2:B6="A")*(E2:E6)) SUM((A2:A6="name1")*(B2:B6="D")*(E2:E6)) SUM((A2:A6="name2")*(B2:B6="A")*(E2:E6)) SUM((A2:A6="name2")*(B2:B6="D")*(E2:E6)) You'll need to press Shift+Ctrl+Enter to enter the formula otherwise you may get incorrect results. To solve your problem with name changes you should reference the names from the summary sheet rather than hard coding them into the formulae. You can count the number of operations using: CountIf(A2:A6,"name1") Hope this is useful :-) Rob -----Original Message----- Hello, I hope somebody can help. I have a sheet ordered in the following way client sign quantity price name1 A 3 12 name1 D 4 57 name2 A 2 12 name2 A 4 100 name2 D 3 10 where A means the client has bought something and D means he is selling. I would need a macro that will give on a new sheet the output of the total operations of the client and how many operations he has done. Example cilent total bought total sold n. of operations name1 36 (i.e. 3x12) 228 2 name2 424 30 3 Unfortunately, the names change every now and then, so inserting the name in the macro would eventually prove pointless. I have some experience with VB, but am totally at loss with this problem (obviously I'm not as good as I wish I were). Thank you very much for any help you might be able to give me. Lorenzo . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
summing first 'n' values in a column or row | Excel Worksheet Functions | |||
Summing a Column - Net and Absolute Values | Excel Worksheet Functions | |||
summing last values in column | Excel Worksheet Functions | |||
Summing one column if two other columns' values appear in other sh | Excel Worksheet Functions | |||
summing values according to name in defferent column | Excel Programming |