Sumproduct with contains

erniepoe

Active Member
Joined
Oct 23, 2006
Messages
375
Office Version
  1. 365
Platform
  1. Windows
Hi all,

I'm trying to use Sumproduct but when i only have a partial match.

In this case, the first part of the formula are months Jan-Dec, and A1 is whatever month you are looking at.

In column A on the 300-STAT-A tab, i want to add all the rows that contain the word food. I have tried updating the formula with both ="*food*" and ="%food%" as you see below, but no luck.

=SUMPRODUCT(('[January 2020 Actuals + Budget.xlsx]300 - STAT-A'!$B$5:$N$5=A1)*('[January 2020 Actuals + Budget.xlsx]300 - STAT-A'!$A:$A="%FOOD%"),'[January 2020 Actuals + Budget.xlsx]300 - STAT-A'!$B:$N)

Have also been struggling with combining Sumif with index match, but no dice on either.

Any help? Thanks so much.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Try:

=SUMPRODUCT(('300-STAT-A'!B5:M5=A1)*ISNUMBER(SEARCH("food",'300-STAT-A'!A6:A14)),'300-STAT-A'!B6:M14)

You can't use wildcards in SUMPRODUCT, but you can use SEARCH and see if the substring is found with ISNUMBER. If you want to use wildcards, then SUMIFS could work:

=SUMIFS(INDEX('300-STAT-A'!B6:M14,0,MATCH(A1,'300-STAT-A'!B5:M5,0)),'300-STAT-A'!A6:A14,"*food*")

SUMIFS also is "aware" of the last row, so it's more efficient to use if you want to use whole column references:

=SUMIFS(INDEX('300-STAT-A'!B:M,0,MATCH(A1,'300-STAT-A'!B5:M5,0)),'300-STAT-A'!A:A,"*food*")
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

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