count the number of cells that contain a specific date in a specific year from 2 different spreeadsheets

alghazaly

New Member
Joined
Apr 28, 2021
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hello ,

I have a question

I am trying to create a formula that is excuted as following:

I am working on 2 spreadsheets(tabs) named indicators and FNCI maj :

in spreadsheet 1 FNCI maj there are multiple dates from 2017 till 2021

in spreadsheet 2 indicators there are indicators where i am applying the formula

i want a function that could count the number of cells that contain the month march and are in year 2021.

So basically counting all the cells that contain a given month in a given year ,

i've been trying but without success

i tried using this formula

=SUMPRODUCT((MONTH('FNCI maj'!B2:B404)=3)*(YEAR('FNCI maj'!B2:B404)=2021))

Thanks for your help
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi & welcome to MrExcel.
In what way doesn't it work?
 
Upvote 0
@alghazaly - Welcome to the board.

Fluff is right, I just filled some date values in a worksheet (column B) and named like your worksheet, then copied your formula. It works perfectly.

See the sample below:
Book1
BCD
1DateResult for 3/2021
23/5/212
33/7/21
44/2/21
55/1/21
65/3/21
FNCI maj
Cell Formulas
RangeFormula
D2D2=SUMPRODUCT((MONTH('FNCI maj'!B2:B404)=3)*(YEAR('FNCI maj'!B2:B404)=2021))


That's why we use XL2BB by the way. You can copy and paste it into your worksheet to test it.
Or share a sample range to show us how it doesn't work.
 
Upvote 0
1619682991020.png
1619683009130.png
it simply gives mes an error message...
 
Upvote 0
Do you have any text values in the 'FNCI maj'!B2:B404 range, or formulae that return "" or #VALUE!
 
Upvote 0
Solution
indeed! there was one row with a text format , it works perfectly now! thanks for the hint!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0
indeed! there was one row with a text format , it works perfectly now! thanks for the hint!
Glad to hear you got the solution.

Please mark the post that solved your problem by clicking on the check mark icon next to that post next time as I did that for you in this question. It will help future readers to find the solution faster.
Thanks.
 
Upvote 0

Forum statistics

Threads
1,214,391
Messages
6,119,244
Members
448,879
Latest member
VanGirl

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