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!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Is the named range for the exclusions Excl_Name or Exkl_Name?
 
Upvote 0
Is the named range for the exclusions Excl_Name or Exkl_Name?
Sorry :) Lost in translation from Swedish to English... Excl_Name it should be in the formula as well.
 
Upvote 0
In that case try
Excel Formula:
=Sum(SUMIFS(SoL[Hours];SoL[PID];$A7;SoL[FromDate];">="&DataME!$C$1;SoL[ToDate];"<="&DataME!$D$1;SoL[Name];"<>*"&Excl_Name&"*"))
 
Upvote 0
In that case try
Excel Formula:
=Sum(SUMIFS(SoL[Hours];SoL[PID];$A7;SoL[FromDate];">="&DataME!$C$1;SoL[ToDate];"<="&DataME!$D$1;SoL[Name];"<>*"&Excl_Name&"*"))
Not quite - I can see that something is deducted from the hours when there is a partial match in SoL[Name] from the Named Range - however the total hours calculated is 6 times higher then what it should be (in the data total number of hours are 109,81 hours - matching the date range and excluding one Name from the named range. However the sum calculated by the formula is 658,86 (and 658,86 / 109,81 = 6)
 
Upvote 0
Not quite - I can see that something is deducted from the hours when there is a partial match in SoL[Name] from the Named Range - however the total hours calculated is 6 times higher then what it should be (in the data total number of hours are 109,81 hours - matching the date range and excluding one Name from the named range. However the sum calculated by the formula is 658,86 (and 658,86 / 109,81 = 6)
Noticing now that if I add values to the named range (with entries that should be excluded) the total sum calculated increases by the same number of entries (earlier I had 6 entries, now I added two test rows in the named range and the total sum calculated increase).
 
Upvote 0
Oops, as you are using <> it needs to be an AND condition, not an OR condition. Which means with sumifs you would need to put each cell in the named range as a separate criteria.
 
Upvote 0
Try
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))
 
Upvote 0
Try
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))
That returns the error: You've entered too few arguments for this function. The cursor jumps to ";m)"
 
Upvote 0
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))
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,970
Members
449,095
Latest member
Mr Hughes

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