Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
erwt
 
Posts: n/a
Default conditional sum formula


I need a conditional sum formula. this is my sheet:

A - B
id - price
1 - 10
2 - 10
3 - 15
4 - 10
4 - 7
4 - 5

I want to calculate the totalsum of id 4. So i want to get the value
22. I searching now for 2 hours and i cant find a possible formula.
Who can help me!

Thnx


--
erwt
------------------------------------------------------------------------
erwt's Profile: http://www.excelforum.com/member.php...o&userid=26993
View this thread: http://www.excelforum.com/showthread...hreadid=401994

  #2   Report Post  
erwt
 
Posts: n/a
Default


i've got it!!! SUM.IF


--
erwt
------------------------------------------------------------------------
erwt's Profile: http://www.excelforum.com/member.php...o&userid=26993
View this thread: http://www.excelforum.com/showthread...hreadid=401994

  #3   Report Post  
roly
 
Posts: n/a
Default


Hi,

A conditional sum function is SUMIF. It works like this:
=SUMIF(Range,Criteria,Sum Range). The range is the cells you wish to
look for the criteria in; the criteria is what you are looking for,;
the sum range is the cells you want to add up.

The formula you would use for your data below is:

SUMIF(A2:A7,"4",B2:B7)

You can also refer to cells in the criteria, which is useful if you
have a large amount of data.

All the best,


Roly


--
roly
------------------------------------------------------------------------
roly's Profile: http://www.excelforum.com/member.php...o&userid=24631
View this thread: http://www.excelforum.com/showthread...hreadid=401994

  #4   Report Post  
Coober
 
Posts: n/a
Default


A much better way is to use SUMPRODUCT.

Assuming your column "ID" starts in A1 (values start in A2) and your
"PRICES" values start in B2.

Enter:

=SUMPRODUCT((A2:A7=D1)*(B2:B7))

This looks in the range A2:A7 for values that match D1 (of course this
could be any cell of your choice). For those rows that match, the
corresponding values in B2:B7 are summed. If you have "4" entered in
D1, the formula will result in 22.


Coober


--
Coober
------------------------------------------------------------------------
Coober's Profile: http://www.excelforum.com/member.php...o&userid=27004
View this thread: http://www.excelforum.com/showthread...hreadid=401994

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
Conditional Formatting formula not acceptable? Thief_ Excel Discussion (Misc queries) 4 July 19th 05 11:54 AM
Using a Formula in a Conditional Statement? Templee1 Excel Worksheet Functions 2 July 14th 05 08:40 PM
How to combine conditional format with formula ? merlin68 Excel Worksheet Functions 4 April 14th 05 03:24 AM
conditional formatting formula Jack Sons Excel Discussion (Misc queries) 6 April 5th 05 09:50 AM
Formula Dependant Conditional Formatting LDanix Excel Discussion (Misc queries) 1 January 13th 05 06:50 PM


All times are GMT +1. The time now is 12:21 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"