Counting Dates across rows

erniepoe

Active Member
Joined
Oct 23, 2006
Messages
375
Office Version
  1. 365
Platform
  1. Windows
Hi all, I am trying to find the number of dates in G1:C1 that equal the year of the cell in A1, but I am getting a value error. When I use this formula down columns rather than across rows, it seems to work fine. Is there a workaround to get this to work across rows?

=SUMPRODUCT(--(YEAR(G1:CM1)=YEAR(A1)))
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
That formula works fine. Check that your dates are real dates & not text.
 
Upvote 0
N.B. Which range do you want to calculate, the range in the description or the range in the formula?
Ensure that you do not have text or error messages in the range.
Sum will also work.

T202310a.xlsm
ABCDEFGHIJK
18-Oct-235-May-2310-Oct-232-Feb-2322-May-2310-Oct-24
2
3
422
533
2d
Cell Formulas
RangeFormula
B4B4=SUMPRODUCT(--(YEAR(G1:CM1)=YEAR(A1)))
C4C4=SUM(--(YEAR(G1:CM1)=YEAR(A1)))
B5B5=SUMPRODUCT(--(YEAR(C1:G1)=YEAR(A1)))
C5C5=SUM(--(YEAR(C1:G1)=(YEAR(A1))))
 
Upvote 0

Forum statistics

Threads
1,215,349
Messages
6,124,427
Members
449,158
Latest member
burk0007

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