#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default count formula

I have a column with dates that I'd like to use a count formula where it
counts the total number of rows that match the month and year of a cell. How
can I write the formula to calculate this count? Below is an example of what
I mean, A1 is the cell that I want the count from Col B to match where the
month and year is equal to 11/08. The answer should be 3. Can anyone help me
create this formula?
A1 = 11/25/08

Col B
4/27/07
9/4/07
1/2/08
2/11/08
4/25/08
5/13/08
5/14/08
5/20/08
5/27/08
5/29/08
5/29/08
6/2/08
6/3/08
6/10/08
6/23/08
7/7/08
8/6/08
8/26/08
8/28/08
9/8/08
10/3/08
10/3/08
10/7/08
10/10/08
10/14/08
10/24/08
10/24/08
11/5/08
11/7/08
11/7/08

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200812/1

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default count formula

Use SUMPRODUCT:

=SUMPRODUCT((MONTH(B1:B30)=MONTH($A$1))*(YEAR(B1:B 30)=YEAR($A$1)))


--
Gary''s Student - gsnu2007k


"AHizon via OfficeKB.com" wrote:

I have a column with dates that I'd like to use a count formula where it
counts the total number of rows that match the month and year of a cell. How
can I write the formula to calculate this count? Below is an example of what
I mean, A1 is the cell that I want the count from Col B to match where the
month and year is equal to 11/08. The answer should be 3. Can anyone help me
create this formula?
A1 = 11/25/08

Col B
4/27/07
9/4/07
1/2/08
2/11/08
4/25/08
5/13/08
5/14/08
5/20/08
5/27/08
5/29/08
5/29/08
6/2/08
6/3/08
6/10/08
6/23/08
7/7/08
8/6/08
8/26/08
8/28/08
9/8/08
10/3/08
10/3/08
10/7/08
10/10/08
10/14/08
10/24/08
10/24/08
11/5/08
11/7/08
11/7/08

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200812/1


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 23
Default count formula

Great, this formula worked. Thanks so much!

Gary''s Student wrote:
Use SUMPRODUCT:

=SUMPRODUCT((MONTH(B1:B30)=MONTH($A$1))*(YEAR(B1: B30)=YEAR($A$1)))

I have a column with dates that I'd like to use a count formula where it
counts the total number of rows that match the month and year of a cell. How

[quoted text clipped - 35 lines]
11/7/08
11/7/08


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200812/1

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,059
Default count formula

On Dec 4, 4:37 pm, "AHizon via OfficeKB.com" <u38169@uwe wrote:
I have a column with dates that I'd like to use a count formula where it
counts the total number of rows that match the month and year of a
cell.


Try:

=sumproduct((month(B1:B30)=month(A1))*(year(B1:B30 )=year(A1)))


On Dec 4, 4:37*pm, "AHizon via OfficeKB.com" <u38169@uwe wrote:
I have a column with dates that I'd like to use a count formula where it
counts the total number of rows that match the month and year of a
cell. *How
can I write the formula to calculate this count? *Below is an example of what
I mean, A1 is the cell that I want the count from Col B to match where the
month and year is equal to 11/08. The answer should be 3. *Can anyone
help me create this formula?
A1 = 11/25/08

Col B
4/27/07
9/4/07
1/2/08
2/11/08
4/25/08
5/13/08
5/14/08
5/20/08
5/27/08
5/29/08
5/29/08
6/2/08
6/3/08
6/10/08
6/23/08
7/7/08
8/6/08
8/26/08
8/28/08
9/8/08
10/3/08
10/3/08
10/7/08
10/10/08
10/14/08
10/24/08
10/24/08
11/5/08
11/7/08
11/7/08


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default count formula

=SUMPRODUCT(--(B1:B30-DAY(B1:B30)=A1-DAY(A1)))



"AHizon via OfficeKB.com" wrote:

I have a column with dates that I'd like to use a count formula where it
counts the total number of rows that match the month and year of a cell. How
can I write the formula to calculate this count? Below is an example of what
I mean, A1 is the cell that I want the count from Col B to match where the
month and year is equal to 11/08. The answer should be 3. Can anyone help me
create this formula?
A1 = 11/25/08

Col B
4/27/07
9/4/07
1/2/08
2/11/08
4/25/08
5/13/08
5/14/08
5/20/08
5/27/08
5/29/08
5/29/08
6/2/08
6/3/08
6/10/08
6/23/08
7/7/08
8/6/08
8/26/08
8/28/08
9/8/08
10/3/08
10/3/08
10/7/08
10/10/08
10/14/08
10/24/08
10/24/08
11/5/08
11/7/08
11/7/08

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200812/1




  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,346
Default count formula

Hi,

You could use the following array entered formula

=SUM(N(EOMONTH(A1,-1)=B1:B30-DAY(B1:B30)))
or
=SUM(N(B1:B30-DAY(B1:B30)=A1-DAY(A1)))

To enter these press Shift+Ctrl+Enter.

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"AHizon via OfficeKB.com" wrote:

I have a column with dates that I'd like to use a count formula where it
counts the total number of rows that match the month and year of a cell. How
can I write the formula to calculate this count? Below is an example of what
I mean, A1 is the cell that I want the count from Col B to match where the
month and year is equal to 11/08. The answer should be 3. Can anyone help me
create this formula?
A1 = 11/25/08

Col B
4/27/07
9/4/07
1/2/08
2/11/08
4/25/08
5/13/08
5/14/08
5/20/08
5/27/08
5/29/08
5/29/08
6/2/08
6/3/08
6/10/08
6/23/08
7/7/08
8/6/08
8/26/08
8/28/08
9/8/08
10/3/08
10/3/08
10/7/08
10/10/08
10/14/08
10/24/08
10/24/08
11/5/08
11/7/08
11/7/08

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200812/1


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count Formula - Count Ticks LittleAnn Excel Discussion (Misc queries) 3 May 8th 23 07:44 PM
is there a formula to count something like this.... driller Excel Worksheet Functions 3 July 6th 07 07:16 PM
Trying to construct a count count formula Chris K Excel Discussion (Misc queries) 6 May 26th 07 07:20 PM
Count if formula Neil H Excel Discussion (Misc queries) 3 March 3rd 07 05:10 PM
Count Formula ceej Excel Worksheet Functions 6 July 18th 06 12:02 AM


All times are GMT +1. The time now is 08:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"