Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel...conditional adding

Status
Not open for further replies.

slaga9

Technical User
Jun 8, 2007
46
CA
hi everyone,
I export the results of a ms access query into excel (that’s how management wants it)
In excel I need to do some conditional addition; I'm not sure how to go about it.

X Y Z
1 S 7
2 r
3 S 8
4 r

I want to be able to Sum the Z values of the rows where the X value = S.
I am going to have to do the same for the r value after.

any suggestions on the best way to go about this?
thanks,
Sean
 




Hi,

Check out the SUMIF function.

Skip,

[glasses] To be safe on the [red]FOURTH[/red],
Don't take a [red]FIFTH[/red] on the [red]THIRD[/red]
Or you might not come [red]FORTH[/red] on the [red]FIFTH[/red]
[red][highlight blue]FORTH[/highlight][/red][white][highlight red]WITH[/highlight][/white] [tongue]
 
=sumproduct((X1:X1000="S")*(Z1:Z1000))


[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
If you need to sum for more than a couple of values, set up a pivottable over the data with X as the ROW field and SUM of Z as the DATA field.

This will give you a sum of Z by whatever is in X and should take very little time

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top