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?
Date
Talk Number In
26/10/2014
110
02/11/2014
99
16/11/2014
100
23/11/2014
123
30/11/2014
141
7/12/2014
9
14/12/2014
50
21/12/2014
67
4/1/2015
88
11/1/2015
158
18/1/2015
98

<tbody>
</tbody>
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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,215,575
Messages
6,125,631
Members
449,241
Latest member
NoniJ

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