Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default summing values according to name in defferent column

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
.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default summing values according to name in defferent column

Don, Rob, thank you both for your help and your time, I really
appreciate it. Still, I'm not to sure what to do with the formulae (I
know this sounds weird, but I feel a lot more at ease with macros).
Rob, thanks for the suggestion on the new column with the total value
Referencing the names would take way too long (there are some 1300
names). Besides, new names are added every now and then, meaning I
would have to explain the process to every other person using the file
(and the names in the original DB are retreived from an AS400). What I
had in mind was a macro that worked sort of like this:

If name in next cell is the same and value in column B is A, then
sum value in col. F
until next cell = blank

And make a second similare macro for the D operations, adding for both
something that will count how many cells have been summed.
I hope this makes sense and that you may be able to help me - VB
knowledge just seems to be something I will never fully acheive.
Again, thank so much for all your help.
Lorenzo
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
summing first 'n' values in a column or row Fran McConville Excel Worksheet Functions 5 April 17th 23 07:01 PM
Summing a Column - Net and Absolute Values BRob Excel Worksheet Functions 4 May 8th 08 01:06 PM
summing last values in column gotta know Excel Worksheet Functions 11 December 27th 06 01:51 PM
Summing one column if two other columns' values appear in other sh JulieU Excel Worksheet Functions 3 April 18th 06 04:48 PM
summing values according to name in defferent column Don Guillett[_4_] Excel Programming 0 July 28th 03 01:40 PM


All times are GMT +1. The time now is 11:06 PM.

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

About Us

"It's about Microsoft Excel"