Multiple conditions with SUM or COUNT

MichaelCreamer

New Member
Joined
Feb 9, 2005
Messages
3
I am trying to using the following formula to calculate the sum of values in column C where 1) The ** appears anywhere in the value of column A and 2) the value of "Red" is in column B.

=SUMPRODUCT((A1:A6="*~*~*")*(B1:B6="Red")*(C1:C6))

table.gif


The wildcard * does not seem to work here. (It does seem to work in COUNTIF and SUMIF but I need to check multiple conditions.)

Is there a way to use wildcard characters here to search for a string anywhere in the value?

I cannot use RIGHT(A1:A7,2), for instance, because the ** (or whatever string) may not always be at the end.

Thanks for any and all help!
Michael
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Using cell references instead of hard-coding conditions...

=SUMPRODUCT(--ISNUMBER(SEARCH(SUBSTITUTE(E1,"*","~*"),$A$1:$A$7)),--($B$1:$B$7=E2),$C$1:$C$7)

where E1 houses ** and E2 Red.
 
Upvote 0

Forum statistics

Threads
1,215,676
Messages
6,126,156
Members
449,295
Latest member
DSBerry

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top