Counting dates

asnedge1

New Member
Joined
Jan 30, 2025
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi
We have an excel spreadsheet recording health & safety data across the company.


We'd like to show the count of site inspections undertaken each month in the Scorecard1 tab. The data is held on the SHEQ-Inspections tab in column B.

Can anyone help with a formula for this please?
 

Attachments

  • Scorecard1.jpg
    Scorecard1.jpg
    29.2 KB · Views: 9
  • SHEQ-Inspections.jpg
    SHEQ-Inspections.jpg
    63.6 KB · Views: 8
Hello,

With month number in cell C1

Excel Formula:
=SUMPRODUCT(1*(MONTH(B:B)=C1))
 
Upvote 0
That's because you've changed the formula. ;)
I also suspect that it should also take into account the year.
It seems to work if a table column is used or range but not the entire column.

It doesn't like blank cells. It calculates these as month 1.

Sample Data.xlsm
ABCDEFGHIJKLMNOPQ
1123456789101112Date
2120/01/202410485641122010202120/01/2024
3218/07/202411122010202118/07/2024
4326/11/202426/11/2024
5426/03/202431122010202126/03/2024
6518/05/202418/05/2024
7624/04/202424/04/2024
8709/11/202409/11/2024
9823/09/202423/09/2024
10915/02/202415/02/2024
111009/04/202409/04/2024
121118/05/202418/05/2024
131215/12/202415/12/2024
141309/09/202409/09/2024
15
16
17
Sheet2
Cell Formulas
RangeFormula
E1:O1E1=D1+1
D2:O2D2=SUMPRODUCT(1*(MONTH($B:$B)=D1))
D3:O3D3=SUMPRODUCT(1*(MONTH(Table20[Date])=D1))
D5D5=SUMPRODUCT(1*(MONTH(B2:B16)=D1))
E5:O5E5=SUMPRODUCT(1*(MONTH($B:$B)=E1))
A3:A14A3=A2+1
Named Ranges
NameRefers ToCells
_FilterDatabase=Sheet2!$D$1:$O$3E1, D5, D2:D3
 
Upvote 0
Oh thank you very much for the precision. Indeed, I only tested it on a table, and on the full column but for month>1...
What a pity. If you guys have better solutions, i thought this one was smart & small, but it is actually too small 😅
 
Upvote 0
Hi
We have an excel spreadsheet recording health & safety data across the company.


We'd like to show the count of site inspections undertaken each month in the Scorecard1 tab. The data is held on the SHEQ-Inspections tab in column B.

Can anyone help with a formula for this please?
Cab you submit the chart and data sheet using XL2BB as it is not clear where your chart data comes from?
 
Upvote 0

Forum statistics

Threads
1,226,771
Messages
6,192,926
Members
453,767
Latest member
922aloose

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