ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Counting values containing part of a cell (https://www.excelbanter.com/excel-worksheet-functions/19373-counting-values-containing-part-cell.html)

davidm

Counting values containing part of a cell
 
I have a list of dates and wish to count the number of times February
appears. If I search for a specific date such as 03 February 2005 I have no
problem but if I wish to find all values containing part of the cell, in this
case the month, I become stuck.

Fredrik Wahlgren


"davidm" wrote in message
...
I have a list of dates and wish to count the number of times February
appears. If I search for a specific date such as 03 February 2005 I have

no
problem but if I wish to find all values containing part of the cell, in

this
case the month, I become stuck.


Use the MONTH function in a different column to get the month. Use COUNTIF
to count the ocurrences of the month you're looking for.

/Fredrik



Bob Phillips

=SUMPRODUCT(--(MONTH(A1:A20)=2)

or

=SUMPRODUCT(--(TEXT(A1:A20,"mmm")="Feb"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"davidm" wrote in message
...
I have a list of dates and wish to count the number of times February
appears. If I search for a specific date such as 03 February 2005 I have

no
problem but if I wish to find all values containing part of the cell, in

this
case the month, I become stuck.




davidm

Cheers Bob. That's solved the problem and a lot of frustration in endlessly
trawling through excel help.

"Bob Phillips" wrote:

=SUMPRODUCT(--(MONTH(A1:A20)=2)

or

=SUMPRODUCT(--(TEXT(A1:A20,"mmm")="Feb"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"davidm" wrote in message
...
I have a list of dates and wish to count the number of times February
appears. If I search for a specific date such as 03 February 2005 I have

no
problem but if I wish to find all values containing part of the cell, in

this
case the month, I become stuck.






All times are GMT +1. The time now is 10:38 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com