Sumproduct / Sumifs

Tikey

Board Regular
Joined
Jan 30, 2014
Messages
148
Office Version
  1. 2021
Platform
  1. Windows
Hi

I am trying to sum a number of values in 3 columns, if the year from a date in another column is correct and if the values in another column contain an x, which could be in any position in the cells. My spreadsheet could contain several thousand rows, but I have included a small example. I am also wishing to avoid using a helper column.


A​
B​
C​
D​
E​
1​
3​
09/07/2020​
64XBC10
2​
2​
09/07/2020​
64XBC10
3​
6​
09/07/2020​
64XBC10
4​
16​
4​
09/07/2022​
64FX12
5​
3​
2​
09/07/2022​
64XA12
6​
1​
4​
10/07/2022​
64FGT12
7​
1​
11/07/2021​
64FX12
8​
2​
13/07/2021​
64XFC15
9​
3​
1​
1​
13/07/2021​
64XFC15
10​
1​
16/07/2021​
64XFC15

So, if I wanted to sum the values in columns A,B,C if the year was 2022 and the values in column E contained an x, I would expect the result to be 25.

I have managed to do this with SUMIFS using the following formula, but it will only sum a single column, if I try to sum all 3 I get a #Value! error.
=SUMIFS(A2:A11,D2:D11,">="&DATE(2022,1,1),$D2:$D11,"<="&DATE(2022,12,31),E2:E11,"*x*")
I have tried to use SUMPRODUCT without success, but believe you cannot use wildcards with this.

Can anyone offer a solution please.

 
Thanks very much, that works great. Rather than using refs for the 3 seperate columns, could I just use b2:d11 ?
I best not in case I get a incorrect answer and I don't realise. Thanks very much for your help.
also, i placed a reference for the year (if you don't want that you can hard code it in the formula). Additionally, I used FIND with an upper case X, the search function doesn't care about upper or lower case.

if you find that one of the posts here solves your questions. please mark that post as the answer.

Best wishes! Happy to help.
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
how about
=SUM(FILTER($A$2:C$33,(YEAR($D$2:$D$33)=2022)*(ISNUMBER(SEARCH("X",$E$2:$E$33,1)))))

Book7
ABCDEFG
1
237/9/2064XBC1025
327/9/2064XBC10
467/9/2064XBC10
51647/10/2264FX12
6327/11/22aaaX
7147/12/2264FGT12
811/1/2364FX12
921/2/2364XFC15
103111/3/2364XFC15
1111/4/2364XFC15
Sheet1
Cell Formulas
RangeFormula
G2G2=SUM(FILTER($A$2:C$32,(YEAR($D$2:$D$32)=2022)*(ISNUMBER(SEARCH("X",$E$2:$E$32,1)))))

That works well, thank you.
 
Upvote 0

Forum statistics

Threads
1,214,952
Messages
6,122,454
Members
449,083
Latest member
Ava19

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