Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Count a cell in month format

Cell data:
15-Feb REG
22-Feb REG
8-Mar REG
15-Mar REG
15-Mar REG
29-Mar APIN
29-Mar REG
29-Mar REG
29-Mar REG
29-Mar APIN
29-Mar APIN
5-Apr SHOP
12-Apr APIN
12-Apr APIN
26-Apr SHOP
Pulled NSTA
Pulled NSTA
Pulled NSTA
Pulled SHOP
Pulled SHOP
Pulled NSTA


The above columns are C and D, and I am trying to force A1 to give me a
count when column C is in the month of March, and D = "reg". I have a macro
that filters C and D by the selected macro, so the month value will need to
change according to the macro. I tried COUNT, and other versions, but it
doesn't like that.

Help?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Count a cell in month format

Try
=SUMPRODUCT((MONTH(C1:C100)=3)*(D1:D100="reg"))

--
Jacob


"Mike Wheeler" wrote:

Cell data:
15-Feb REG
22-Feb REG
8-Mar REG
15-Mar REG
15-Mar REG
29-Mar APIN
29-Mar REG
29-Mar REG
29-Mar REG
29-Mar APIN
29-Mar APIN
5-Apr SHOP
12-Apr APIN
12-Apr APIN
26-Apr SHOP
Pulled NSTA
Pulled NSTA
Pulled NSTA
Pulled SHOP
Pulled SHOP
Pulled NSTA


The above columns are C and D, and I am trying to force A1 to give me a
count when column C is in the month of March, and D = "reg". I have a macro
that filters C and D by the selected macro, so the month value will need to
change according to the macro. I tried COUNT, and other versions, but it
doesn't like that.

Help?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Count a cell in month format

The MONTH function will return an error when it tries to process that later
cells containing "Pulled". Could try this array* formula Mike:

=SUM((MONTH(IF(ISNUMBER(A1:A21),A1:A21,0))=3)*(B1: B21="reg"))

Note that the "=3" part is the section that control which month you are
looking at.
*Array formulas must be confirmed using Ctrl+Shift+Enter, not just Enter.

--
Best Regards,

Luke M
"Jacob Skaria" wrote in message
...
Try
=SUMPRODUCT((MONTH(C1:C100)=3)*(D1:D100="reg"))

--
Jacob


"Mike Wheeler" wrote:

Cell data:
15-Feb REG
22-Feb REG
8-Mar REG
15-Mar REG
15-Mar REG
29-Mar APIN
29-Mar REG
29-Mar REG
29-Mar REG
29-Mar APIN
29-Mar APIN
5-Apr SHOP
12-Apr APIN
12-Apr APIN
26-Apr SHOP
Pulled NSTA
Pulled NSTA
Pulled NSTA
Pulled SHOP
Pulled SHOP
Pulled NSTA


The above columns are C and D, and I am trying to force A1 to give me a
count when column C is in the month of March, and D = "reg". I have a
macro
that filters C and D by the selected macro, so the month value will need
to
change according to the macro. I tried COUNT, and other versions, but it
doesn't like that.

Help?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Count a cell in month format

Hi,

The non-dates in the date range give a problem with a standard sumproduct so
try this

=SUMPRODUCT((ISNUMBER(FIND("Mar",TEXT(C1:C21,"mmm" ))))*(D1:D21="Reg"))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Mike Wheeler" wrote:

Cell data:
15-Feb REG
22-Feb REG
8-Mar REG
15-Mar REG
15-Mar REG
29-Mar APIN
29-Mar REG
29-Mar REG
29-Mar REG
29-Mar APIN
29-Mar APIN
5-Apr SHOP
12-Apr APIN
12-Apr APIN
26-Apr SHOP
Pulled NSTA
Pulled NSTA
Pulled NSTA
Pulled SHOP
Pulled SHOP
Pulled NSTA


The above columns are C and D, and I am trying to force A1 to give me a
count when column C is in the month of March, and D = "reg". I have a macro
that filters C and D by the selected macro, so the month value will need to
change according to the macro. I tried COUNT, and other versions, but it
doesn't like that.

Help?

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Count a cell in month format

Ah, this is the one that worked. THANK YOU. Now I just need to try and
format a cell to base the month off of instead of creating 12 macros, one for
each month. But that is easy.

Thanks!

"Mike H" wrote:

Hi,

The non-dates in the date range give a problem with a standard sumproduct so
try this

=SUMPRODUCT((ISNUMBER(FIND("Mar",TEXT(C1:C21,"mmm" ))))*(D1:D21="Reg"))
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Mike Wheeler" wrote:

Cell data:
15-Feb REG
22-Feb REG
8-Mar REG
15-Mar REG
15-Mar REG
29-Mar APIN
29-Mar REG
29-Mar REG
29-Mar REG
29-Mar APIN
29-Mar APIN
5-Apr SHOP
12-Apr APIN
12-Apr APIN
26-Apr SHOP
Pulled NSTA
Pulled NSTA
Pulled NSTA
Pulled SHOP
Pulled SHOP
Pulled NSTA


The above columns are C and D, and I am trying to force A1 to give me a
count when column C is in the month of March, and D = "reg". I have a macro
that filters C and D by the selected macro, so the month value will need to
change according to the macro. I tried COUNT, and other versions, but it
doesn't like that.

Help?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Count a cell in month format

Oops. I missed that. Try out this non-array formula...

=SUMPRODUCT((TEXT(C1:C100,"mmmyyyy")="MAR2010")*(D 1:D100="reg"))


--
Jacob


"Luke M" wrote:

The MONTH function will return an error when it tries to process that later
cells containing "Pulled". Could try this array* formula Mike:

=SUM((MONTH(IF(ISNUMBER(A1:A21),A1:A21,0))=3)*(B1: B21="reg"))

Note that the "=3" part is the section that control which month you are
looking at.
*Array formulas must be confirmed using Ctrl+Shift+Enter, not just Enter.

--
Best Regards,

Luke M
"Jacob Skaria" wrote in message
...
Try
=SUMPRODUCT((MONTH(C1:C100)=3)*(D1:D100="reg"))

--
Jacob


"Mike Wheeler" wrote:

Cell data:
15-Feb REG
22-Feb REG
8-Mar REG
15-Mar REG
15-Mar REG
29-Mar APIN
29-Mar REG
29-Mar REG
29-Mar REG
29-Mar APIN
29-Mar APIN
5-Apr SHOP
12-Apr APIN
12-Apr APIN
26-Apr SHOP
Pulled NSTA
Pulled NSTA
Pulled NSTA
Pulled SHOP
Pulled SHOP
Pulled NSTA


The above columns are C and D, and I am trying to force A1 to give me a
count when column C is in the month of March, and D = "reg". I have a
macro
that filters C and D by the selected macro, so the month value will need
to
change according to the macro. I tried COUNT, and other versions, but it
doesn't like that.

Help?



.

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 month when date is in day/month/year format ccKennedy Excel Worksheet Functions 6 April 30th 09 03:32 AM
Count numbers of Month in a cell Navarat Mishra Excel Worksheet Functions 4 February 23rd 09 11:34 AM
count the occurrences of a month in a date&time cell Tom Excel Worksheet Functions 6 February 14th 08 05:05 PM
Count duplicate cell values per month Derek Excel Worksheet Functions 7 November 26th 07 06:53 PM
How can I format a cell so date field only displays the Month? tk_2u Excel Discussion (Misc queries) 3 December 4th 04 12:54 AM


All times are GMT +1. The time now is 11:21 AM.

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

About Us

"It's about Microsoft Excel"