Wild cards in formulas for sumproducts

LISAR

Board Regular
Joined
Aug 10, 2002
Messages
85
Hi,
trying to do sumproducts with wildcard for search criteria and it doesn't seem to work.

This is a simpler version of what I am trying to do. I have multiple criteria for the sumproduct (like 4 or 5 columns), but have just put a simple example below. I have also shown that the wildcard works for the countif and sumif functions. Does anyone know what the wildcard is in a sumproduct.

Type in A1 = "cost to work"
Type in A2 = "the things we "
Type in A3 = "can costs everything"
Type in B1 = 10
Type in B2 = 10
Type in B3 = 20
Type in formula in A5 = =SUMIF(D3:D5,"*cost*",E3:E5)
= Result of 30
Type in formula in A6 = =COUNTIF(D3:D5,"*cost*")
= Result of 2
Type in formula in A7 = =SUMPRODUCT(--(D3:D5="*cost*"))
= Result of 0 which is INCORRECT it should be 2

Any ideas of what the wildcard is in SUMPRODUCT formula
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi,
trying to do sumproducts with wildcard for search criteria and it doesn't seem to work.

This is a simpler version of what I am trying to do. I have multiple criteria for the sumproduct (like 4 or 5 columns), but have just put a simple example below. I have also shown that the wildcard works for the countif and sumif functions. Does anyone know what the wildcard is in a sumproduct.

Type in A1 = "cost to work"
Type in A2 = "the things we "
Type in A3 = "can costs everything"
Type in B1 = 10
Type in B2 = 10
Type in B3 = 20
Type in formula in A5 = =SUMIF(D3:D5,"*cost*",E3:E5)
= Result of 30
Type in formula in A6 = =COUNTIF(D3:D5,"*cost*")
= Result of 2
Type in formula in A7 = =SUMPRODUCT(--(D3:D5="*cost*"))
= Result of 0 which is INCORRECT it should be 2

Any ideas of what the wildcard is in SUMPRODUCT formula

For a single criteria SUMIF should suffice, for multi conditional counting/summing a generic approach,

=SUMPRODUCT(--(ISNUMBER(SEARCH("cost",Range))),--(Range="Criteria))
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,652
Members
448,975
Latest member
sweeberry

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