# Countifs comparing dates in same table

#### jdanilog

##### New Member
Hi everyone,
It is my first time using this service so hoping I will find the answer I need...

I got this table named TableTimeData:

OPP Number [Project: Created Date] [Site Visit - Completed Date]
0001 11/01/2018 03/15/2019
0002 12/01/2018 03/31/2019
0003 03/01/2019 03/15/2019

In another sheet called INPUT I got this cells with the following values:

G7 I7 Q7
03/01/2019 03/31/2019 20

What I need is to count all rows in table TableTimeData that has the Site Visit Completed Date (Site Visit - Completed Date) within this dates 03/01/2019 and 03/31/2019 and has been site visited (Site Visit - Completed Date) a day NOT more than 20 days after the creation (Project: Created Date).

I wrote the following formula but it seem that the last criteria (in red) has something wrong:

=COUNTIFS(TableTimeData[Site Visit - Completed Date],">="&INPUT!\$G\$7,TableTimeData[Site Visit - Completed Date],"<="&INPUT!\$I\$7,TableTimeData[Project: Created Date],">="&TableTimeData[Site Visit - Completed Date]-\$Q\$7)

The expected result must be 2.

### Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

#### DanteAmor

##### Well-known Member
Try this

=SUMAPRODUCTO((TableTimeData[Site Visit - Completed Date]>=G7)*(TableTimeData[Site Visit - Completed Date]<=I7)*(TableTimeData[Site Visit - Completed Date]-TableTimeData[Project: Created Date]>20)*1)

Replies
8
Views
121
Replies
5
Views
110
Replies
1
Views
161
Replies
12
Views
127
Replies
5
Views
351

1,127,771
Messages
5,626,785
Members
416,202
Latest member
donya ba

### 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.

### Which adblocker are you using?

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

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