COUNTIF / SUMPRODUCT with WEEKNUM

lukasz_rz

New Member
Joined
Oct 13, 2013
Messages
48
Hello Guys.

A quick and simple question (too difficult for me though).

I have a column with dates (Column A). I need to count the number of records that are from the certain year (YEAR formula) and certain week (WEENNUM) without using any additional calculation columns (file is big, a lot of records, don't want to slow it down more).

I've tried with COUNTIF, but what I've read is that it won't work. I've tried SUMPRODUCT, but it is not working for me either.

Please help. I appreciate.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
How about
=SUMPRODUCT((YEAR(A2:A31)=2019)*(ISOWEEKNUM(A2:A31)=5))
 
Upvote 0
Firstly NEVER use whole columns in an array formula, it can seriously slow down your workbook.
Decide what the max range is likely to be & add a small margin for error. So if you think that the max number of rows will be 1,000 use something like A2:A2000
I suspect that you have text values somewhere in the range, which would give you the #value error
 
Upvote 0
Firstly NEVER use whole columns in an array formula, it can seriously slow down your workbook.
Decide what the max range is likely to be & add a small margin for error. So if you think that the max number of rows will be 1,000 use something like A2:A2000
I suspect that you have text values somewhere in the range, which would give you the #value error


You are totally right.
Yes, the problem was with the first row, which is a text format :) I will follow your advice.
Additional question: what if I want to add the next condition which is simply: the cell in column B = "X". I've received #N/A error this time, when I've tried.
 
Upvote 0
That should work fine.
Check that you don't have any #N/A values in col O
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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