Counting the number of occurrences in a calendar year based on location

leveyc

Board Regular
Joined
Oct 14, 2009
Messages
163
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi,

I have a few thousand rows of historical data, based on when a location was setup and operational (date exists in a column in the data), I need to count how many times in any given year of the past ten years the location was visited (date exists in a column in the data) and then by site, hope this makes sense and thanks in advance for the help

Data

Data FormatResults
LocationOpenedVisitedOpened20152016201720182019
Site 12/3/184/1/18201511
Site 12/3/186/7/182016
Site 12/3/184/1/192017
Site 12/3/187/24/20201821
Site 26/7/159/16/17
Site 26/7/1511/6/18
Sites20152016201720182019
Site 121
Site 211
Site 3
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
MrExcelPlayground4.xlsx
ABCDEFGHIJ
1Data FormatResults
2LocationOpenedVisitedOpened20152016201720182019
3Site 12/3/20184/1/20182015  11 
4Site 12/3/20186/7/20182016     
5Site 12/3/20184/1/20192017     
6Site 12/3/20187/24/20202018   21
7Site 26/7/20159/16/2017
8Site 26/7/201511/6/2018
9Sites20152016201720182019
10Site 1   21
11Site 2  11 
12Site 3     
Sheet30
Cell Formulas
RangeFormula
F3:J6F3=SUMPRODUCT(--(YEAR($B$3:$B$8)=$E3),--(YEAR($C$3:$C$8)=F$2))
F10:J12F10=SUMPRODUCT(--($A$3:$A$8=$E10),--(YEAR($C$3:$C$8)=F$2))
 
Upvote 0

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

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