Count duplicate dates within a formula (no ranges)

Retroshift

Board Regular
Joined
Sep 20, 2016
Messages
119
Office Version
  1. 2019
Platform
  1. Windows
Hi
I have a reference cell B2 which contains the year.
I would like to create a formula that contains dates (not referenced in cells) and counts the duplicate dates.

Within the formula I have the fixed dates DATE(YEAR(B2),1,1),DATE(YEAR(B2),3,2),DATE(YEAR(B2),5,1),DATE(YEAR(B2),5,9) and I would like to check them off against some floating fictitious UDF dates EasterDate(YEAR(B2))-10,EasterDate(YEAR(B2))-5. Depending on the year in cell B2, some dates might overlap. Is there a formula/array to count/sum up these duplicate dates within the formula?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
If the value in B2 is the number 2022 or even YEAR(DATEVALUE(1/1/2022)), the value of DATE(YEAR(B2),5,1) is 05/01/1905. Is that really what you want/need? Perhaps you could paste a Mini Table using XL2BB?
 
Upvote 0
What I would like is to have a workaround which makes (date) formulas work as array constants within a formula, instead of ranges.
Cell B2 contains a dynamic year.
I would like to count the possible duplicates between the first four dates as compared to the last two (easter)dates.
Below is the formula which I would like to make work through a workaround: is there a way to return the dates as constants so they could be compared to each other (in an array)?

Excel Formula:
=SUMPRODUCT(1/COUNTIF((DATE(YEAR(B2),1,1),DATE(YEAR(B2),3,2),DATE(YEAR(B2),5,1),DATE(YEAR(B2),5,9)),(EasterDate(YEAR(B2))-10,EasterDate(YEAR(B2))-5)))

I have Excel 2019.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,114
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