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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Problems with 'sumif' 1

Status
Not open for further replies.

shytott

Technical User
Aug 25, 2003
131
GB
I am having problems with sumif. What I’d like to do is to sum 3 numbers depending on whether a specific cell contains X,Y or Z, but I can only get my formula to ‘see’ the fisrt cell in the target range. Ie my formula in cell A5 is:
=sumif(A1,”X”,A2:A4). If A1 to A4 has the values, X,2,3,4 then my formula is returning a value of 2 instead of 9
There will be 365 lines of this formula with the 1st cell having X Y or Z and 2nd – 4th cells having a wide variety or values. I will have 3 columns to create a total for each of the X Y or Z ‘s

Many Thanks
 
I'm not sure what you want to do, but you don't seem to get the SumIf formula.

The argument for SumIf are as follows:
=sumif(range,criteria,sum_range)

-Range is a range where you are looking for your criteria
-Criteria is what you're looking for in the Range
-Sum_Range is the range that gets summed with the Criteria is found in the Range

Example:
[tt]
A B
1 X 1
2 2
3 X 3
4 4
5 X 5[/tt]

=Sumif(A1:A5,"X", b1:b5)
Would return 9.

So, what is it that you are trying to accomplish?

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

Help us help you. Please read FAQ181-2886 before posting.
 
Sounds like you need something more like =IF(A1="X",sum(A2:A4),0) rather than using the SUMIF function.

Fen
 
You just need to modify the formula a tad:

=SUMIF(D1:D5,"X",E1:E5)

Good luck!
 
Thanks Guys

FENRIRSHOWL had the solution I needed - it works a treat :)

Sorry in the delay getting back to you- I have limited internet access!

Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top