SUMIF with multiple conditions + Wildcard in Name

DaleVacaro

New Member
Joined
Jun 1, 2021
Messages
11
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hi All,

May you help me with below? Name in Column "H" will be the lookup value vs "A" and "D". Other condition is in the table:

1623350311907.png
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
It would be considerably more helpful if you'd provide your sample data using XL2BB.
 
Upvote 0
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Tested with only a few rows of data (6 w/data and 1 header row). Surely, there's another approach that would be shorter and possible more efficient, but I tried to implement the logic first before trying to simplify.

Code:
=SUMPRODUCT(($B$2:$B$7)*($E$2:$E$7="Apple")*($F$2:$F$7="Yes")*(1<=--LEFT($C$2:$C$7,1))*(7>=--LEFT($C$2:$C$7,1))*(IF(ISNUMBER(FIND(LEFT(H2,FIND("Country",H2)-2),$D$2:$D$7)),1,0)))
 
Upvote 0
Tested with only a few rows of data (6 w/data and 1 header row). Surely, there's another approach that would be shorter and possible more efficient, but I tried to implement the logic first before trying to simplify.

Code:
=SUMPRODUCT(($B$2:$B$7)*($E$2:$E$7="Apple")*($F$2:$F$7="Yes")*(1<=--LEFT($C$2:$C$7,1))*(7>=--LEFT($C$2:$C$7,1))*(IF(ISNUMBER(FIND(LEFT(H2,FIND("Country",H2)-2),$D$2:$D$7)),1,0)))
Hello kweaver! Thank you very much it works! Can you help me incorporate Column A too? Needs to match this too with country name with other details I have
 
Upvote 0
I too tested on a subset of the data, which is why the totals below don't match what you'd expect from your test data. But if you put just the name in column H, instead of having to extract it, you can use this formula:

Book1
HI
1NameFormula
2United States20
3New York0
4Malaysia0
5Thailand0
Sheet3
Cell Formulas
RangeFormula
I2:I5I2=SUM(SUMIFS(B:B,A:A,"*"&H2&"*",C:C,{1,2,3,4,5,6,7}&"*",D:D,"*"&H2&"*",E:E,"Apple",F:F,"Yes"))
 
Upvote 0
I'm the opposite of a fan of array formulas. You might consider using a helper column, if you're like me. There is also a "SUMIFS" formula that allows you to include only results that meet multiple criteria from multiple columns. That format is like this:

=SUMIFS(column to sum, criteria column 1, criteria, criteria column 2, criteria, ....).
 
Upvote 0
Hello kweaver! Thank you very much it works! Can you help me incorporate Column A too? Needs to match this too with country name with other details I have
Code:
=SUMPRODUCT(($B$2:$B$7)*($E$2:$E$7="Apple")*($F$2:$F$7="Yes")*(1<=--LEFT($C$2:$C$7,1))*(7>=--LEFT($C$2:$C$7,1))*(IF(ISNUMBER(FIND(LEFT(H4,FIND("Country",H4)-2),$D$2:$D$7)),1,0))*(IF(ISNUMBER(FIND(LEFT(H4,FIND("Country",H4)-2),$A$2:$A$7)),1,0)))
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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