View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Sum If using 2 criterias

=SUMPRODUCT(--(month_range=C3),--(account_range=B6),amount_range)

Each element in these arrays will evaluate to either TRUE or FALSE:

(month_range=C3)
(account_range=B6)

The "--" coerces these logical values (TRUE, FALSE) to numbers. 1 for TRUE
and 0 for FALSE.

Then all 3 arrays are multiplied together and totaled for the final result.

See this for an extensive discussion:

http://xldynamic.com/source/xld.SUMPRODUCT.html

Biff

"Michael" wrote in message
...
Dr. Valko!!

Worked Like a charm!! Just one question so that I can learn from this,
what
does "--" do for the formula??

Thanks!!!!!

"T. Valko" wrote:

Try this:

=SUMPRODUCT(--(month_range=C3),--(account_range=B6),amount_range)

Biff

"Michael" wrote in message
...
Hi,

I have 2 worksheets, one sheet with the columns listed below and the
other
sheet summarizes the activity entered in the first tab.

Column A = "Amount"
Column B = "Account"
Column C = "Month"

What I am trying to do is: SUMIF("Month"=Cell(C3) and "Account" =
Cell(B6))
then return the "Amount" based on the criteria.

How would I create a formula to do just that?

Please let me know if need to further explain.