SUMIFS exclude value if partial match in list/named range

ausswe

New Member
Joined
Feb 19, 2013
Messages
35
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi,
I've been playing around with SUMIFS to get a formula that sums multiple criteria but also excludes some values if found as a partial match in a named range.
I have added partial text strings in a list with the named range "Excl_Name" and am trying to get SUMIFS to sum all matches in column SoL[Name] unless there is a parital match in the list Excl_Name but so far I haven't been able to get it to work.

I have managed to get it to work with wildcard and one specific criteria but not for a whole list and I haven't been able to see a solution when looking around online.

Can this be done by using SUMIFS? (I have also tried with SUMPRODUCT, but I have read that SUMIFS will be quicker to calculate - seeing that the dataset is very large.

So far I have (but doesn't work:
Excel Formula:
=SUMIFS(SoL[Hours];SoL[PID];$A7;SoL[FromDate];">="&DataME!$C$1;SoL[ToDate];"<="&DataME!$D$1;SoL[Name];"<>Exkl_Name")

I have also tried the following which results in #SPILL:
Excel Formula:
=SUMIFS(SoL[Hours];SoL[PID];$A7;SoL[FromDate];">="&DataME!$C$1;SoL[ToDate];"<="&DataME!$D$1;SoL[Name];"<>*&Exkl_Name&"*")

I would appreciate any thoughts on this.

Thanks!
 
Missed a bit from the iferror
Excel Formula:
 =FILTER(SoL[Hours];(SoL[PID]=$A7)*(SoL[FromDate]>=DataME!$C$1)*(SoL[ToDate]<=DataME!$D$1)*(MAP(SoL[Name];LAMBDA(m;SUM(IFERROR(SEARCH(Excl_Name;m);0))))=0))
Aha, ok. At first I got a #SPILL error so I moved the formula to the first row (3) and removed all previous data below in the column. This returned #CALC (Empty Arrays are not allowed):
Excel Formula:
=FILTER(SoL[Hours];(SoL[PID]=$A3)*(SoL[FromDate]>=DataME!$C$1)*(SoL[ToDate]<=DataME!$D$1)*(MAP(SoL[Name];LAMBDA(m;SUM(IFERROR(SEARCH(Excl_Name;m);0))))=0))
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I'll get there in the end it needs to be wrapped in sum
Excel Formula:
=sum(FILTER(SoL[Hours];(SoL[PID]=$A3)*(SoL[FromDate]>=DataME!$C$1)*(SoL[ToDate]<=DataME!$D$1)*(MAP(SoL[Name];LAMBDA(m;SUM(IFERROR(SEARCH(Excl_Name;m);0))))=0)))
 
Upvote 0
I'll get there in the end it needs to be wrapped in sum
Excel Formula:
=sum(FILTER(SoL[Hours];(SoL[PID]=$A3)*(SoL[FromDate]>=DataME!$C$1)*(SoL[ToDate]<=DataME!$D$1)*(MAP(SoL[Name];LAMBDA(m;SUM(IFERROR(SEARCH(Excl_Name;m);0))))=0)))
That still returns #CALC! (Empty array), I tried using "Show Calculation Steps" but that only made Excel crash altogether :)
 
Upvote 0
That error suggests that you have nothing that matches all criteria.
 
Upvote 0
That error suggests that you have nothing that matches all criteria.
Thanks, I copied the formula down for the column and am realising that the calculations will take a very long time for this formula each time (the data that it has to go through is approx 100,000 rows of data).

Is it better/safer/faster to use something with SUMIFS and state the Names that should be matched in a named range instead?
 
Upvote 0
If you're copying the formula down 100,000 any formula is going to take time.
 
Upvote 0
If you're copying the formula down 100,000 any formula is going to take time.
No it's copied down approx 3500 rows, but the dataset it's calculating the sum from is approx. 100,000.
 
Upvote 0
In that case you can try using a sumifs instead & see how long that takes.
 
Upvote 0
This is probably too close to Fluff's to be any faster but give it a try anyway:
Excel Formula:
=SUM(
(SoL[PID]=$A$7)
*(SoL[FromDate]>=DataME!$C$1)
*(SoL[ToDate]<=DataME!$D$1)
*(LET(aRow;--ISNUMBER(SEARCH(TRANSPOSE(Excl_Name);SoL[Name]));
BYROW(aRow;LAMBDA(r;SUM(r)=0)))))
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,951
Members
449,095
Latest member
nmaske

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