# CountA if that row has correct date

#### celestersue

##### New Member
So I am trying to calculate if there was any data in Column D and Column A has the correct date associated in that row:

A1= 4/1/2013
D1= data

A2= 4/2/2013
D2=

A3= 4/1/2013
D3= data

So my formula could be something like this:
=CountA(D:D), AND(A:A, "4/1/2013")
and it would come up with the answer: 2

However that formula isn't correct and I can't wrap my head around how to fix it. How do I adjust it so that it will only count the number of cells that have data in them if the date is equal to the date in the formula?

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

##### MrExcel MVP
So I am trying to calculate if there was any data in Column D and Column A has the correct date associated in that row:

A1= 4/1/2013
D1= data

A2= 4/2/2013
D2=

A3= 4/1/2013
D3= data

So my formula could be something like this:
=CountA(D:D), AND(A:A, "4/1/2013")
and it would come up with the answer: 2

However that formula isn't correct and I can't wrap my head around how to fix it. How do I adjust it so that it will only count the number of cells that have data in them if the date is equal to the date in the formula?

Something like:

=SUMPRODUCT(--ISNUMBER(A2:A500),1-ISBLANK(A2:A500))

=SUMPRODUCT(--ISNUMBER(A2:A500),1-(A2:A500=""))

#### celestersue

##### New Member
Aladin, that works to calculate that there is data in that column and gives me a total, but it doesn't help me in narrowing it down so that I know that the date is equal to 4/1/2013 and there is data in that column on that row. So instead of counting all 24 cells that have data it should only give me the 2 that have the right date associated.

##### MrExcel MVP
Aladin, that works to calculate that there is data in that column and gives me a total, but it doesn't help me in narrowing it down so that I know that the date is equal to 4/1/2013 and there is data in that column on that row. So instead of counting all 24 cells that have data it should only give me the 2 that have the right date associated.

I meant:

=SUMPRODUCT(--ISNUMBER(A2:A500),1-ISBLANK(D2:D500))

=SUMPRODUCT(--ISNUMBER(A2:A500),1-(D2:D500=""))

This counts all of the data and date records.

If you want to calculate the number of data points associated with 4/1/2013...

=SUMPRODUCT(--(A2:A500=F2),1-ISBLANK(D2:D500))

where F2 is a date of interest.

#### dulitul

##### Board Regular

=countifs(a1:a500,"4/1/2013",d1:d500,"<>""")

#### celestersue

##### New Member

I meant:

=SUMPRODUCT(--ISNUMBER(A2:A500),1-ISBLANK(D2:D500))

=SUMPRODUCT(--ISNUMBER(A2:A500),1-(D2:D500=""))

This counts all of the data and date records.

If you want to calculate the number of data points associated with 4/1/2013...

=SUMPRODUCT(--(A2:A500=F2),1-ISBLANK(D2:D500))

where F2 is a date of interest.

##### MrExcel MVP

You are welcome. Thanks for providing feedback. Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

### Forum statistics

1,164,149
Messages
5,835,683
Members
430,375
Latest member
datdog22 ### 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