You can use SUMPRODUCT like this:
=SUMPRODUCT(--(A3:A10="MA"),--(B3:B10>5000),F3:F10)
Your state abbreviations are in A3:A10, your numbers to test on are in
B3:B10, and the numbers to sum are in F3:F10 (column 6). Change to
suit your circumstance.
You can use SUMPRODUCT like this:
=SUMPRODUCT(--(A3:A10="MA"),--(B3:B10>5000),F3:F10)
Your state abbreviations are in A3:A10, your numbers to test on are in
B3:B10, and the numbers to sum are in F3:F10 (column 6). Change to
suit your circumstance.
Thank you, Mark.
What if the condition is an "or" (not and). Either the first or the second
condition is met, then do the sum up...
"Mark Lincoln" wrote:
> You can use SUMPRODUCT like this:
>
> =SUMPRODUCT(--(A3:A10="MA"),--(B3:B10>5000),F3:F10)
>
> Your state abbreviations are in A3:A10, your numbers to test on are in
> B3:B10, and the numbers to sum are in F3:F10 (column 6). Change to
> suit your circumstance.
>
>
That complicates matters some. We have to sum the rows in which either
criterion is met and subtract the rows where both are met (otherwise
the latter cases would be counted twice). Either of these work:
=SUMPRODUCT(--(A3:A10="MA"),F3:F10)+SUMPRODUCT(--(B3:B10>5000),F3:F10)-SUMPRODUCT(--(A3:A10="MA"),--(B3:B10>5000),F3:F10)
=SUMIF(A3:A10,"MA",F3:F10)+SUMIF(B3:B10,">5000",F3:F10)-SUMPRODUCT(--(A3:A10="MA"),--(B3:B10>5000),F3:F10)
This is a bit shorter:
=SUMPRODUCT(--((A3:A10="MA")+(B3:B10>5000)>0),F3:F10)
In article <1146163561.677247.234460@u72g2000cwu.googlegroups.com>,
"Mark Lincoln" <mlincoln@earthlink.net> wrote:
> That complicates matters some. We have to sum the rows in which either
> criterion is met and subtract the rows where both are met (otherwise
> the latter cases would be counted twice). Either of these work:
>
> =SUMPRODUCT(--(A3:A10="MA"),F3:F10)+SUMPRODUCT(--(B3:B10>5000),F3:F10)-SUMPROD
> UCT(--(A3:A10="MA"),--(B3:B10>5000),F3:F10)
>
> =SUMIF(A3:A10,"MA",F3:F10)+SUMIF(B3:B10,">5000",F3:F10)-SUMPRODUCT(--(A3:A10="
> MA"),--(B3:B10>5000),F3:F10)
Oops, didn't see the identical solution in the other subthread...
In article <jemcgimpsey-5E3D43.17503727042006@msnews.microsoft.com>,
JE McGimpsey <jemcgimpsey@mvps.org> wrote:
> This is a bit shorter:
>
> =SUMPRODUCT(--((A3:A10="MA")+(B3:B10>5000)>0),F3:F10)
>
Hi!
Try this (using Marks example):
=SUMPRODUCT(--((A3:A10="MA")+(B3:B10>5000)>0),F3:F10)
Biff
"xwenx" <xwenx@discussions.microsoft.com> wrote in message
news:80FC0DBA-045A-4CB3-BD39-AADEB3939C4D@microsoft.com...
> Thank you, Mark.
> What if the condition is an "or" (not and). Either the first or the second
> condition is met, then do the sum up...
>
> "Mark Lincoln" wrote:
>
>> You can use SUMPRODUCT like this:
>>
>> =SUMPRODUCT(--(A3:A10="MA"),--(B3:B10>5000),F3:F10)
>>
>> Your state abbreviations are in A3:A10, your numbers to test on are in
>> B3:B10, and the numbers to sum are in F3:F10 (column 6). Change to
>> suit your circumstance.
>>
>>
Good solution, Biff. Nice and neat!
I was trying something similar but got a #VALUE error. Then my
solutions suggested themselves to me and in the interests of time (I do
this during slack moments at work) I dropped my original effort.
Three solutions to one problem. That's why I like this newsgroup. :-)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks