rFor example: SUMIF(B2:B7, "Apple OR Orange", C2:C7) If it's an apple or an
orange, sum their values in column c.
It does not work. Can anyone help?
rFor example: SUMIF(B2:B7, "Apple OR Orange", C2:C7) If it's an apple or an
orange, sum their values in column c.
It does not work. Can anyone help?
=SUMPRODUCT(--(((B2:B7="apple")+(B2:B7="orange"))>0),C2:C7)
"iampritzy" wrote:
> rFor example: SUMIF(B2:B7, "Apple OR Orange", C2:C7) If it's an apple or an
> orange, sum their values in column c.
> It does not work. Can anyone help?
As long as the conditions are disjoint (they can't both be satisfied as the
same time), just add the results of multiple sumif's:
=sumif(b2:b7,"Apple",c2:c7)+sumif(b2:b7,"Orange",c2:c7)
"iampritzy" wrote:
> rFor example: SUMIF(B2:B7, "Apple OR Orange", C2:C7) If it's an apple or an
> orange, sum their values in column c.
> It does not work. Can anyone help?
Long intuitive version..
=3DSUMPRODUCT(SUMIF(B2:B7, {"Apple","Orange"},C2:C7))
...slightly shorter but less intuitive.
=3DSUMPRODUCT((B2:B7=3D{"Apple","Orange"})*C2:C7)
Hard coding the sum up values should be avoided.
You could put them into a cell range, in this case J1 and K1, one =
variable per cell.
=3DSUMPRODUCT((B2:B7=3DJ1:K1)*C2:C7)
Use J1:J2 and it wont work, the range size having to be the same and all =
that, but for some reason it don't apply if it goes in another =
direction, or for Sumif - go figure.
=3DSUMPRODUCT(SUMIF(B2:B17,J1:J2,C2:C7))
Regards
Robert McCurdy
"iampritzy" <iampritzy@discussions.microsoft.com> wrote in message =
news:FB58785B-9086-402F-81B5-9BD0A16A68E5@microsoft.com...
rFor example: SUMIF(B2:B7, "Apple OR Orange", C2:C7) If it's an apple =
or an=20
orange, sum their values in column c.
It does not work. Can anyone help?
I tried all solutions you guys provided. Thank you all.
"EvolBob" wrote:
> Long intuitive version..
>
> =SUMPRODUCT(SUMIF(B2:B7, {"Apple","Orange"},C2:C7))
>
> ...slightly shorter but less intuitive.
>
> =SUMPRODUCT((B2:B7={"Apple","Orange"})*C2:C7)
>
> Hard coding the sum up values should be avoided.
> You could put them into a cell range, in this case J1 and K1, one variable per cell.
>
> =SUMPRODUCT((B2:B7=J1:K1)*C2:C7)
>
> Use J1:J2 and it wont work, the range size having to be the same and all that, but for some reason it don't apply if it goes in another direction, or for Sumif - go figure.
>
> =SUMPRODUCT(SUMIF(B2:B17,J1:J2,C2:C7))
>
>
> Regards
> Robert McCurdy
>
> "iampritzy" <iampritzy@discussions.microsoft.com> wrote in message news:FB58785B-9086-402F-81B5-9BD0A16A68E5@microsoft.com...
> rFor example: SUMIF(B2:B7, "Apple OR Orange", C2:C7) If it's an apple or an
> orange, sum their values in column c.
> It does not work. Can anyone help?
>
surely simpler.....
=SUM(SUMIF(B2:B7,{"Apple","Orange"},C2:C7))
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks