How can I do a SUMIF the YEAR() equals to 2020?

excelos

Well-known Member
Joined
Sep 25, 2011
Messages
591
Office Version
  1. 365
Platform
  1. Windows
Hello

I have the following data:

Column1: 1, 2, 3,...
Column2: 01/12/1999,01/01/2000,01/02/2000,...

I want to sum the values in Column1 only when the corresponding date in the cell below has a specific year e.g. 2020.

How can I do that?

Thanks!
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
What version of Excel are you using?
Please update your account details to show this, as it affects which functions you can use.

Also please post some sample data using the XL2BB add-in.
 
Upvote 0
I updated my details but I cannot install the plug in as it is not allowed for my version.

The data is:

01/01/2000​
1​
01/06/2000​
2​
01/11/2000​
3​
01/04/2001​
4​
01/09/2001​
5​
01/02/2002​
6​
01/07/2002​
7​
01/12/2002​
8​
01/05/2003​
9​
01/10/2003​
10​
01/03/2004​
11​
01/08/2004​
12​
01/01/2005​
13​

I want to create a third column which will display the sum of the second column for the cells that the first column has the same year.

E.g. the first cell in the third column (C1) should return the sum of the B1,B2,B3 cells of the second column because these cells have the same year as the cell A1
 
Upvote 0
Ok how about
+Fluff v2.xlsm
ABC
1
201/01/200016
306/01/200026
411/01/200036
504/01/200149
609/01/200159
702/01/2002621
807/01/2002721
912/01/2002821
1005/01/2003919
1110/01/20031019
1203/01/20041123
1308/01/20041223
1401/01/20051313
15
16
Work
Cell Formulas
RangeFormula
C2:C14C2=SUM(FILTER($B$2:$B$20,YEAR($A$2:$A$20)=YEAR(A2)))
 
Upvote 0
Brilliant thanks!

I tried SUMIF($B$2:$B$20,YEAR($A$2:$A$20)=YEAR(A2)) or SUMIFS($B$2:$B$20,YEAR($A$2:$A$20),YEAR(A2)) but it didn't work, any idea?
 
Upvote 0
T202011a.xlsm
ABCDEF
1Jan 1, 200016Year
2Jan 2, 20002620032121
3Jan 3, 200036
4Jan 4, 200149
5Jan 5, 200159
6Jan 6, 2002630
7Jan 7, 2002730
8Jan 8, 2002830
9Jan 9, 2002930
10Jan 10, 20031021
11Jan 11, 20031121
12Jan 12, 20041225
13Jan 13, 20041325
14Jan 14, 20051414
3c
Cell Formulas
RangeFormula
E2E2=SUMIFS(B:B,A:A,">="&DATE(D2,1,1),A:A,"<="&DATE(D2,12,31))
F2F2=SUMPRODUCT(--(YEAR($A$1:$A$14)=D2),$B$1:$B$14)
C1:C14C1=SUMPRODUCT(--(YEAR($A$1:$A$14)=YEAR(A1)),$B$1:$B$14)
 
Upvote 0

Forum statistics

Threads
1,215,635
Messages
6,125,945
Members
449,275
Latest member
jacob_mcbride

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