Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Counting Occurences Between Dates

Hi All:

I have data that contains a variety of dates that I have sorted by date. I
am trying to count the nuber of occurences in a given month. EI:

Customer x 1/1/07
Customer x 1/1/07
Customer x 1/4/07
Customer x 1/5/07
Curtomer x 1/31/07

Total occurences for this customer would equal 5.
I have been trying Countif function but it is not returning any value other
than 0 or 1, so I believe that I am missing a step. I have looked through
some of the previous posts but did not see anything that may pertain to what
I am looking for. Thank you in advance for any advice you may offer.

Blddrgn

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Counting Occurences Between Dates

=SUMPRODUCT(--(A1:A100="Customer x"),--(MONTH(B1:B100)=1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Blddrgn700" wrote in message
...
Hi All:

I have data that contains a variety of dates that I have sorted by date. I
am trying to count the nuber of occurences in a given month. EI:

Customer x 1/1/07
Customer x 1/1/07
Customer x 1/4/07
Customer x 1/5/07
Curtomer x 1/31/07

Total occurences for this customer would equal 5.
I have been trying Countif function but it is not returning any value
other
than 0 or 1, so I believe that I am missing a step. I have looked through
some of the previous posts but did not see anything that may pertain to
what
I am looking for. Thank you in advance for any advice you may offer.

Blddrgn



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Counting Occurences Between Dates

On Mon, 22 Oct 2007 10:35:04 -0700, Blddrgn700
wrote:

Hi All:

I have data that contains a variety of dates that I have sorted by date. I
am trying to count the nuber of occurences in a given month. EI:

Customer x 1/1/07
Customer x 1/1/07
Customer x 1/4/07
Customer x 1/5/07
Curtomer x 1/31/07

Total occurences for this customer would equal 5.
I have been trying Countif function but it is not returning any value other
than 0 or 1, so I believe that I am missing a step. I have looked through
some of the previous posts but did not see anything that may pertain to what
I am looking for. Thank you in advance for any advice you may offer.

Blddrgn


=countif(a:a,"="&date(2007,1,1) - countif(a:a,""&date(2007,1,28)


--ron
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Counting Occurences Between Dates



"Bob Phillips" wrote:

=SUMPRODUCT(--(A1:A100="Customer x"),--(MONTH(B1:B100)=1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Blddrgn700" wrote in message
...
Hi All:

I have data that contains a variety of dates that I have sorted by date. I
am trying to count the nuber of occurences in a given month. EI:

Customer x 1/1/07
Customer x 1/1/07
Customer x 1/4/07
Customer x 1/5/07
Curtomer x 1/31/07

Total occurences for this customer would equal 5.
I have been trying Countif function but it is not returning any value
other
than 0 or 1, so I believe that I am missing a step. I have looked through
some of the previous posts but did not see anything that may pertain to
what
I am looking for. Thank you in advance for any advice you may offer.

Blddrgn



Bob,


Thank you I follow the information you provided. In my example I left out a
valuable piece of information the date field is over two years 2006 and 2007.
So I see in your formula month equals 1 that would count all first month
data. Now with this being over two years were would the reference
distinguish between those two years. I apolgize for leaving that crucial
piece out in my original example.

Blddrgn
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,118
Default Counting Occurences Between Dates

If you're always counting occurrences for an entire month...
try something like this:

A1:A20 contains Customer Names
B1:B20 contains dates

C1: (a customer to search for)
D1: (a date)

This formula counts the occurrences of the customer in C1 where the Col_B date is in the same year and month as the date in D1:
=SUMPRODUCT((A1:A20=C1)*(TEXT(B1:B20,"yyyymm")=TEX T(D1,"yyyymm")))

or if you prefer this method:
=SUMPRODUCT(--(A1:A20=C1),--(TEXT(B1:B20,"yyyymm")=TEXT(D1,"yyyymm")))

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"Blddrgn700" wrote in message ...
Hi All:

I have data that contains a variety of dates that I have sorted by date. I
am trying to count the nuber of occurences in a given month. EI:

Customer x 1/1/07
Customer x 1/1/07
Customer x 1/4/07
Customer x 1/5/07
Curtomer x 1/31/07

Total occurences for this customer would equal 5.
I have been trying Countif function but it is not returning any value other
than 0 or 1, so I believe that I am missing a step. I have looked through
some of the previous posts but did not see anything that may pertain to what
I am looking for. Thank you in advance for any advice you may offer.

Blddrgn





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Counting Occurences Between Dates



"Ron Coderre" wrote:

If you're always counting occurrences for an entire month...
try something like this:

A1:A20 contains Customer Names
B1:B20 contains dates

C1: (a customer to search for)
D1: (a date)

This formula counts the occurrences of the customer in C1 where the Col_B date is in the same year and month as the date in D1:
=SUMPRODUCT((A1:A20=C1)*(TEXT(B1:B20,"yyyymm")=TEX T(D1,"yyyymm")))

or if you prefer this method:
=SUMPRODUCT(--(A1:A20=C1),--(TEXT(B1:B20,"yyyymm")=TEXT(D1,"yyyymm")))

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)

"Blddrgn700" wrote in message ...
Hi All:

I have data that contains a variety of dates that I have sorted by date. I
am trying to count the nuber of occurences in a given month. EI:

Customer x 1/1/07
Customer x 1/1/07
Customer x 1/4/07
Customer x 1/5/07
Curtomer x 1/31/07

Total occurences for this customer would equal 5.
I have been trying Countif function but it is not returning any value other
than 0 or 1, so I believe that I am missing a step. I have looked through
some of the previous posts but did not see anything that may pertain to what
I am looking for. Thank you in advance for any advice you may offer.

Blddrgn



Ron,


The second formula when I moved the outcome cell onto the same worksheet as
the data.

Thanks all who replied!!!

Blddrgn700
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default Counting Occurences Between Dates

=SUMPRODUCT(--(A1:A100="Customer
x"),--(MONTH(B1:B100)=1),--(YEAR(B1:B100)=2007))


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"Blddrgn700" wrote in message
...


"Bob Phillips" wrote:

=SUMPRODUCT(--(A1:A100="Customer x"),--(MONTH(B1:B100)=1))

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my
addy)

"Blddrgn700" wrote in message
...
Hi All:

I have data that contains a variety of dates that I have sorted by
date. I
am trying to count the nuber of occurences in a given month. EI:

Customer x 1/1/07
Customer x 1/1/07
Customer x 1/4/07
Customer x 1/5/07
Curtomer x 1/31/07

Total occurences for this customer would equal 5.
I have been trying Countif function but it is not returning any value
other
than 0 or 1, so I believe that I am missing a step. I have looked
through
some of the previous posts but did not see anything that may pertain to
what
I am looking for. Thank you in advance for any advice you may offer.

Blddrgn



Bob,


Thank you I follow the information you provided. In my example I left out
a
valuable piece of information the date field is over two years 2006 and
2007.
So I see in your formula month equals 1 that would count all first month
data. Now with this being over two years were would the reference
distinguish between those two years. I apolgize for leaving that crucial
piece out in my original example.

Blddrgn



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
Counting occurences of a name [email protected] Excel Worksheet Functions 3 October 8th 07 12:52 AM
Counting the occurences riomarde Excel Worksheet Functions 1 March 27th 06 09:00 PM
Counting Occurences Pete Excel Discussion (Misc queries) 7 May 2nd 05 08:28 PM
Counting occurences of a specific day between two dates coal_miner Excel Worksheet Functions 1 April 20th 05 03:37 PM
Counting Number of Occurences Darren Excel Discussion (Misc queries) 1 February 23rd 05 03:26 PM


All times are GMT +1. The time now is 02:45 PM.

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"