Counting dates after a given date

BenElliott

Board Regular
Joined
Jul 19, 2012
Messages
144
What is wrong with this formula?
{=SUM(--(FREQUENCY(IF((LocalHistory[Date]<=EOMONTH(NOW(),-48)),MATCH(LocalHistory[Talk Number In],LocalHistory[Talk Number In],0)),ROW(LocalHistory[Talk Number In])-ROW($A$2)+1)>0))}

It refers to an XL table named LocalHistory of which the below is a small extract:
If I change the operator ">=" to "<" the formula works but, with EOMONTH(NOW(),0 calculating as 30 Nov 2018 the formula should be returning a result on this table extract of 6 not the #N/A as I do. Therefore, what is wrong with this formula?[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Date
[/TD]
[TD]Talk Number In
[/TD]
[/TR]
[TR]
[TD]26/10/2014
[/TD]
[TD]110
[/TD]
[/TR]
[TR]
[TD]02/11/2014
[/TD]
[TD]99
[/TD]
[/TR]
[TR]
[TD]16/11/2014
[/TD]
[TD]100
[/TD]
[/TR]
[TR]
[TD]23/11/2014
[/TD]
[TD]123
[/TD]
[/TR]
[TR]
[TD]30/11/2014
[/TD]
[TD]141
[/TD]
[/TR]
[TR]
[TD]7/12/2014
[/TD]
[TD]9
[/TD]
[/TR]
[TR]
[TD]14/12/2014
[/TD]
[TD]50
[/TD]
[/TR]
[TR]
[TD]21/12/2014
[/TD]
[TD]67
[/TD]
[/TR]
[TR]
[TD]4/1/2015
[/TD]
[TD]88
[/TD]
[/TR]
[TR]
[TD]11/1/2015
[/TD]
[TD]158
[/TD]
[/TR]
[TR]
[TD]18/1/2015
[/TD]
[TD]98
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You formula counts the dates before (including) a given date (30 Nov 2014). It returned 5 as expected.

If you do want after 30 Nov 2014 try
=SUM(--(FREQUENCY(IF((LocalHistory[Date]>EOMONTH(NOW(),-48)),MATCH(LocalHistory[Talk Number In],LocalHistory[Talk Number In],0)),ROW(LocalHistory[Talk Number In])-ROW($A$2)+1)>0))

M.
 
Last edited:
Upvote 0
Thanks for your comments, Marcelo.

You confirmed what I thought. There is nothing wrong with my formula. Therefore, there must be something wrong with my data.

On checking, I realised that, because I have some talks scheduled for some time in the future, I actually have dates in my database up to the end of 2019 but of course, the majority of these don't have talk numbers entered and it was these blank cells that was causing the #N/A error. Now I know where my formula needs amending to eliminate blank cells.

Cheers.

Ben
 
Upvote 0

Forum statistics

Threads
1,223,948
Messages
6,175,575
Members
452,652
Latest member
eduedu

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