ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sumproduct: condition with ? (https://www.excelbanter.com/excel-discussion-misc-queries/117037-sumproduct-condition.html)

Sarah

Sumproduct: condition with ?
 
Hi the

Am using a sumproduct formula that looks like this:
=sumproduct(A1:A10="Y")*(B1:B105),(C1:C10)
Which did not work
So I tried
=sumproduct(A1:A10="Y")*(B1:B10"5"),(C1:C10)
Which did not work either.

Does some product not work with numeric conditions like 5? Is it only for
text conditions like ="Y"?
Thanks!


Dave Peterson

Sumproduct: condition with ?
 
Maybe you meant:

=sumproduct((A1:A10="Y")*(B1:B105),(C1:C10))

Notice the extra set of ()'s.

I like this style better:
=sumproduct(--(A1:A10="Y"),--(B1:B105),(C1:C10))



Sarah wrote:

Hi the

Am using a sumproduct formula that looks like this:
=sumproduct(A1:A10="Y")*(B1:B105),(C1:C10)
Which did not work
So I tried
=sumproduct(A1:A10="Y")*(B1:B10"5"),(C1:C10)
Which did not work either.

Does some product not work with numeric conditions like 5? Is it only for
text conditions like ="Y"?
Thanks!


--

Dave Peterson

Miguel Zapico

Sumproduct: condition with ?
 
The error is on the parenthesis. Thy this one:
=sumproduct((A1:A10="Y")*(B1:B105),(C1:C10))

Hope this helps,
Miguel.

"Sarah" wrote:

Hi the

Am using a sumproduct formula that looks like this:
=sumproduct(A1:A10="Y")*(B1:B105),(C1:C10)
Which did not work
So I tried
=sumproduct(A1:A10="Y")*(B1:B10"5"),(C1:C10)
Which did not work either.

Does some product not work with numeric conditions like 5? Is it only for
text conditions like ="Y"?
Thanks!


bobb

Sumproduct: condition with ?
 
Use sumproduct((A1:A10="Y")*(B1:B105)*(C1:C10)) or you can use
sumproduct(--(A1:A10="Y"),--(B1:B105),--(C1:C10)

"Sarah" wrote:

Hi the

Am using a sumproduct formula that looks like this:
=sumproduct(A1:A10="Y")*(B1:B105),(C1:C10)
Which did not work
So I tried
=sumproduct(A1:A10="Y")*(B1:B10"5"),(C1:C10)
Which did not work either.

Does some product not work with numeric conditions like 5? Is it only for
text conditions like ="Y"?
Thanks!



All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com