Counting number of rows where datediff of two columns meet criteria

rmillman

New Member
Joined
Aug 21, 2013
Messages
1
I have a range of data and need to summarize some of the data. In the table below is an example of the data. I would like to have a single formula where I can count the number of rows where the end date - start date is < 14 days. I would prefer not to add an additional column for the datediff value. Is there a way to do this with either arrays or named ranges?
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Name
[/TD]
[TD]Start
[/TD]
[TD]End
[/TD]
[TD]Other data
[/TD]
[/TR]
[TR]
[TD]Verizon
[/TD]
[TD]1/10/2010
[/TD]
[TD]1/25/2010
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]AT&T
[/TD]
[TD]3/2/2010
[/TD]
[TD]4/14/2010
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Hi,

Assuming that your data starts in A1,

=SUMPRODUCT(((C2:C8-B2:B8)<14)*(1))

or

=SUMPRODUCT(((C2:C8-B2:B8)<14)*((C2:C8-B2:B8)<>0)*(1))

to exlude rows where the difference is zero
 
Upvote 0

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