A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Count instances of text in date entries



 
 
Thread Tools Display Modes
  #1  
Old July 18th, 2008, 07:51 PM posted to microsoft.public.excel.worksheet.functions
MilusC
external usenet poster
 
Posts: 4
Default Count instances of text in date entries

I'm using Excel 2007. I have a column of dates in this format - 04-Aug-08,
15-Jul-08, etc. I would like to count the number of times a certain month
shows up in the column, i.e. how many of the dates in the column are in Aug,
how many in Jul, etc. I've tried:

=COUNTIF(B4:B40,"Aug")
=COUNTIF(B4:B40,"*Aug*")
=COUNTIF(B4:B40,"-Aug-")

none of these formulas works. Please help. Thanks.

  #2  
Old July 18th, 2008, 07:56 PM posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom[_2_]
external usenet poster
 
Posts: 963
Default Count instances of text in date entries

=SUMPRODUCT(--(ISNUMBER(B2:B40)),--(MONTH(B2:B40)=8))

The isnumber part is for blank cells since they are otherwise counted as
January
If you don't have any blank cells you can use

=SUMPRODUCT(--(MONTH(B2:B40)=8))

8 of course is the index number for August



--


Regards,


Peo Sjoblom

"MilusC" wrote in message
...
I'm using Excel 2007. I have a column of dates in this format - 04-Aug-08,
15-Jul-08, etc. I would like to count the number of times a certain month
shows up in the column, i.e. how many of the dates in the column are in
Aug,
how many in Jul, etc. I've tried:

=COUNTIF(B4:B40,"Aug")
=COUNTIF(B4:B40,"*Aug*")
=COUNTIF(B4:B40,"-Aug-")

none of these formulas works. Please help. Thanks.



  #3  
Old July 18th, 2008, 08:03 PM posted to microsoft.public.excel.worksheet.functions
RagDyeR
external usenet poster
 
Posts: 3,482
Default Count instances of text in date entries

Try this:

=SUMPRODUCT((B4:B40"")*(MONTH(B4:B40)=8))
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"MilusC" wrote in message
...
I'm using Excel 2007. I have a column of dates in this format - 04-Aug-08,
15-Jul-08, etc. I would like to count the number of times a certain month
shows up in the column, i.e. how many of the dates in the column are in
Aug,
how many in Jul, etc. I've tried:

=COUNTIF(B4:B40,"Aug")
=COUNTIF(B4:B40,"*Aug*")
=COUNTIF(B4:B40,"-Aug-")

none of these formulas works. Please help. Thanks.



  #4  
Old July 18th, 2008, 08:40 PM posted to microsoft.public.excel.worksheet.functions
MilusC[_2_]
external usenet poster
 
Posts: 2
Default Count instances of text in date entries

That worked! Thanks for the help.
--
Cal


"Peo Sjoblom" wrote:

=SUMPRODUCT(--(ISNUMBER(B2:B40)),--(MONTH(B2:B40)=8))

The isnumber part is for blank cells since they are otherwise counted as
January
If you don't have any blank cells you can use

=SUMPRODUCT(--(MONTH(B2:B40)=8))

8 of course is the index number for August



--


Regards,


Peo Sjoblom

"MilusC" wrote in message
...
I'm using Excel 2007. I have a column of dates in this format - 04-Aug-08,
15-Jul-08, etc. I would like to count the number of times a certain month
shows up in the column, i.e. how many of the dates in the column are in
Aug,
how many in Jul, etc. I've tried:

=COUNTIF(B4:B40,"Aug")
=COUNTIF(B4:B40,"*Aug*")
=COUNTIF(B4:B40,"-Aug-")

none of these formulas works. Please help. Thanks.




  #5  
Old July 18th, 2008, 08:41 PM posted to microsoft.public.excel.worksheet.functions
MilusC[_2_]
external usenet poster
 
Posts: 2
Default Count instances of text in date entries

Couldn't get this formula to give me the right answer. Maybe because there
are blank cells in the column. See other reply. Thank you.
--
Cal


"RagDyer" wrote:

Try this:

=SUMPRODUCT((B4:B40"")*(MONTH(B4:B40)=8))
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"MilusC" wrote in message
...
I'm using Excel 2007. I have a column of dates in this format - 04-Aug-08,
15-Jul-08, etc. I would like to count the number of times a certain month
shows up in the column, i.e. how many of the dates in the column are in
Aug,
how many in Jul, etc. I've tried:

=COUNTIF(B4:B40,"Aug")
=COUNTIF(B4:B40,"*Aug*")
=COUNTIF(B4:B40,"-Aug-")

none of these formulas works. Please help. Thanks.




  #6  
Old July 18th, 2008, 09:07 PM posted to microsoft.public.excel.worksheet.functions
RagDyeR
external usenet poster
 
Posts: 3,482
Default Count instances of text in date entries

Wonder why?

Both formulas should perform the same.
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"MilusC" wrote in message
...
Couldn't get this formula to give me the right answer. Maybe because there
are blank cells in the column. See other reply. Thank you.
--
Cal


"RagDyer" wrote:

Try this:

=SUMPRODUCT((B4:B40"")*(MONTH(B4:B40)=8))
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------

"MilusC" wrote in message
...
I'm using Excel 2007. I have a column of dates in this format -
04-Aug-08,
15-Jul-08, etc. I would like to count the number of times a certain
month
shows up in the column, i.e. how many of the dates in the column are in
Aug,
how many in Jul, etc. I've tried:

=COUNTIF(B4:B40,"Aug")
=COUNTIF(B4:B40,"*Aug*")
=COUNTIF(B4:B40,"-Aug-")

none of these formulas works. Please help. Thanks.






  #7  
Old August 1st, 2008, 11:41 PM posted to microsoft.public.excel.worksheet.functions
dec697
external usenet poster
 
Posts: 3
Default Count instances of text in date entries

I'm trying to do something similar, however, instead of counting the number
of dates with a particular month, I'm trying to average another column
providing the corresponding cell has the correct month. For example:

If B4:B40 equals august

Average D4 : D40

Can anybody help? thanks.
  #8  
Old August 2nd, 2008, 12:16 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Count instances of text in date entries

Does B4:B40 contain true Excel dates or does it contain the text entry
August?

Try one of these array formulas** :

For true Excel dates:

=AVERAGE(IF(MONTH(B4:B21)=8,D421))

If you might need to get the average for January *and* there might be empty
cells within the range:

=AVERAGE(IF((MONTH(B4:B21)=1)*(ISNUMBER(B4:B21)),D 421))

If you need the month of August for a specific year:

=AVERAGE(IF((MONTH(B4:B21)=1)*(YEAR(B4:B21)=2008), D421))

If the range contains the text entry August:

=AVERAGE(IF(B4:B21="August",D421))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)


--
Biff
Microsoft Excel MVP


"dec697" wrote in message
...
I'm trying to do something similar, however, instead of counting the
number
of dates with a particular month, I'm trying to average another column
providing the corresponding cell has the correct month. For example:

If B4:B40 equals august

Average D4 : D40

Can anybody help? thanks.



  #9  
Old August 2nd, 2008, 03:19 PM posted to microsoft.public.excel.worksheet.functions
dec697
external usenet poster
 
Posts: 3
Default Count instances of text in date entries

=AVERAGE(IF((MONTH(B4:B21)=1)*(ISNUMBER(B4:B21)),D 421))

I used the above formula and it didn't work.
  #10  
Old August 2nd, 2008, 05:15 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Count instances of text in date entries

There's a typo in that formula. It's testing for January.

For August, array entered** :

=AVERAGE(IF((MONTH(B4:B21)=8)*(ISNUMBER(B4:B21)),D 421))

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER)

--
Biff
Microsoft Excel MVP


"dec697" wrote in message
...
=AVERAGE(IF((MONTH(B4:B21)=1)*(ISNUMBER(B4:B21)),D 421))

I used the above formula and it didn't work.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.