SOLVED

Summing the number of instances of an item in each year

%3CLINGO-SUB%20id%3D%22lingo-sub-2747870%22%20slang%3D%22en-US%22%3ESumming%20the%20number%20of%20instances%20of%20an%20item%20in%20each%20year%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2747870%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20all%2C%20first%20time%20asking%20a%20question%20here%20so%20please%20bear%20with%20me.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20large%20table%20of%20ID%20Nos.%20that%20are%20listed%20by%20the%20multiple%20dates%20they%20mentioned%20in%20our%20system.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20well%20as%20sorting%20the%20lists%20by%20these%20IDs%20and%20by%20the%20date%2C%20I've%20also%20been%20asked%20to%20sum%20how%20many%20times%20each%20ID%20occurs%20within%20each%20year.%20I%20assume%20I%20can%20do%20this%20with%20%3CEM%3E%3CSTRONG%3ECOUNTIF%3C%2FSTRONG%3E%3C%2FEM%3E%2C%20but%20have%20never%20used%20it%20before%20and%20would%20like%20to%20request%20some%20guidance%20if%20possible.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20system%20info%20is%20as%20follows%3A%3C%2FP%3E%3CP%3EI%20am%20using%20Excel%20in%20Microsoft365%20Version%202102%20(Build%2013801.20864)%20on%20a%20Windows%2010%20PC.%20I%20hope%20that%20is%20the%20info%20that%20is%20required%2Fhelps.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3E(Very%20simplified)%3C%2FEM%3E%20%3CSTRONG%3EData%20sample%3A%3C%2FSTRONG%3E%3CBR%20%2F%3EColumn%20A%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Column%20B%3CBR%20%2F%3E10%2F05%2F2015%26nbsp%3B%20%26nbsp%3B%20ID005%3CBR%20%2F%3E14%2F12%2F2018%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BID112%3CBR%20%2F%3E08%2F09%2F2021%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3BID005%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThat's%20obviously%20quite%20a%20small%20sample%20as%20it%20goes%20on%20for%20multiple%20pages.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EWhat%20I'm%20hoping%20to%20be%20able%20to%20do%20is%20list%20the%20ID%20and%20then%20the%20number%20of%20instances%20it%20occurs%20in%20each%20year%3C%2FSTRONG%3E%20%3CEM%3E(with%20the%20additional%20%3CSTRONG%3Ebut%20not%20necessary%3C%2FSTRONG%3E%20hope%20that%20this%20will%20continue%20to%20be%20valid%20no%20matter%20how%20many%20additions%20get%20made%20to%20the%20table%20in%20the%20future)%3C%2FEM%3E.%20Is%20this%20possible%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20time%20reading%20this.%20Please%20let%20me%20know%20if%20it%20isn't%20clear%20or%20requires%20further%20clarification.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20apologies%20if%20this%20seems%20a%20too%20simple%20task%20for%20the%20knowledge%20on%20here.%20Any%20help%20at%20all%20would%20be%20greatly%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKind%20regards%3CBR%20%2F%3EJD%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2747870%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2750114%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20the%20number%20of%20instances%20of%20an%20item%20in%20each%20year%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2750114%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1154961%22%20target%3D%22_blank%22%3E%40JohnD76%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThere%20are%20several%20ways%20to%20do%20that%3C%2FP%3E%3CP%3EI%20would%20recommend%20you%20using%20Tables%20and%20Pivot%20Table.%3C%2FP%3E%3CP%3EFirst%20converting%20your%20range%20into%20an%20Excel%20Table.%3C%2FP%3E%3CP%3EThem%20applying%20a%20pivot%20table.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22JulianoPetrukio_0-1631642020334.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F310390iC7A40C860F61A6A1%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JulianoPetrukio_0-1631642020334.png%22%20alt%3D%22JulianoPetrukio_0-1631642020334.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnother%20solution%20is%20using%20formulas%20with%20your%20range%20as%20Table.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DSUMPRODUCT((YEAR(MyData%5BDate%5D)%3DH5)*(MyData%5BID'%23%5D%3DG5))%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EFind%20attached%20an%20example.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2751153%22%20slang%3D%22en-US%22%3ERe%3A%20Summing%20the%20number%20of%20instances%20of%20an%20item%20in%20each%20year%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2751153%22%20slang%3D%22en-US%22%3EThank%20you%20Juliano-Petrukio!!%20I%20really%20appreciate%20you%20spending%20your%20time%20to%20help%20me%20out%20on%20that.%3CBR%20%2F%3E%3CBR%20%2F%3EI'll%20let%20you%20know%20how%20it%20goes.%3CBR%20%2F%3E%3CBR%20%2F%3ECheers%3CBR%20%2F%3EJD%3C%2FLINGO-BODY%3E
New Contributor

Hi all, first time asking a question here so please bear with me.

 

I have a large table of ID Nos. that are listed by the multiple dates they mentioned in our system.

 

As well as sorting the lists by these IDs and by the date, I've also been asked to sum how many times each ID occurs within each year. I assume I can do this with COUNTIF, but have never used it before and would like to request some guidance if possible.

 

The system info is as follows:

I am using Excel in Microsoft365 Version 2102 (Build 13801.20864) on a Windows 10 PC. I hope that is the info that is required/helps.

 

(Very simplified) Data sample:
Column A      Column B
10/05/2015    ID005
14/12/2018     ID112
08/09/2021     ID005


That's obviously quite a small sample as it goes on for multiple pages.

 

What I'm hoping to be able to do is list the ID and then the number of instances it occurs in each year (with the additional but not necessary hope that this will continue to be valid no matter how many additions get made to the table in the future). Is this possible?

 

Thank you for your time reading this. Please let me know if it isn't clear or requires further clarification.

 

My apologies if this seems a too simple task for the knowledge on here. Any help at all would be greatly appreciated.

 

Kind regards
JD

4 Replies
best response confirmed by JohnD76 (New Contributor)
Solution

@JohnD76 

There are several ways to do that

I would recommend you using Tables and Pivot Table.

First converting your range into an Excel Table.

Them applying a pivot table.

 

JulianoPetrukio_0-1631642020334.png

 

Another solution is using formulas with your range as Table.

=SUMPRODUCT((YEAR(MyData[Date])=H5)*(MyData[ID'#]=G5))

Find attached an example.

Thank you Juliano-Petrukio!! I really appreciate you spending your time to help me out on that.

I'll let you know how it goes.

Cheers
JD
Boss was extremely happy with the result! Thank you again!!

Kind regards
JD
Anytime my friend.