Macro to count the amount of times a number is listed

keranali

Rules Violation
Joined
Oct 4, 2010
Messages
234
Office Version
  1. 365
Platform
  1. Windows
Good Day all I have two work sheets, one contains data tab and the other an overview tab with a table to count the amount of times a number is listed per month, and 7 day week, when the month or week 1-4 is inputted. Please see example below:

Data Table
the project M.xlsm
BCD
1DateTimeNum
22-Jan-23Morning33
32-Jan-23Midday21
42-Jan-23Afternoon4
52-Jan-23Evening1
63-Jan-23Morning2
73-Jan-23Midday15
83-Jan-23Afternoon32
93-Jan-23Evening22
104-Jan-23Morning27
114-Jan-23Midday5
124-Jan-23Afternoon32
134-Jan-23Evening35
145-Jan-23Morning18
155-Jan-23Midday12
165-Jan-23Afternoon15
175-Jan-23Evening11
186-Jan-23Morning19
196-Jan-23Midday12
206-Jan-23Afternoon2
216-Jan-23Evening20
227-Jan-23Morning36
237-Jan-23Midday36
Data


Overview tab with the count table:


the project M.xlsm
MNOPQR
18Count
19111325
20211426
213152271
22411628
23511729
24618130
25719131
268201322
279211331
281022134
2911123351
3012224362
Overview
.


Input Table:

the project M.xlsm
AB
1Input
2
3MonthJan
4Week1
Overview


Whereby Jan displays the count for January and Feb For February and Week with a zero value displays the complete month, week 1 displays the first week and week 2 the second etc.
 
The formulas in the N, P and R columns of the 'Overview' sheet are incorrectly modified: that's your problem.
 
Upvote 1
Solution

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Forum statistics

Threads
1,223,893
Messages
6,175,248
Members
452,623
Latest member
cliftonhandyman

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