Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Andy D
 
Posts: n/a
Default How do I count differert items in a column only if the date in an.

I would like to be able to count the number of different iteams in one column
whose dates are less than 30 days older than the current date in another
colunm.

For example column A contains different names, and column B contains date of
birth. I would like to show How many people sharing the same name were born
within the last 30 days.

Is this possible? I have managed to achieve this with IF and AND functions
but this means I have to use 2 other coulmns to get the results (Counting
True/False results) and I would idealy like the table to remain as "clean" as
posssible.

Thanks
Andy
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Andy D
 
Posts: n/a
Default How do I count differert items in a column only if the date in

Thanks for the quick reply Bob, but isn't this the same as doing:

=COUNTIF(B:B,""&(TODAY()-30))

This does give me the number of Dates that are less than 30 days old but I
need to break this number down by the names in column A.

E.G

A B
Andy 01/Feb/2006
Andy 20/Mar/2006
Bob 04/Jan/2006
Bob 22/Mar/2006
Bob 26/Mar/2006

I would like the results to say:

Andy 1
Bob 2

As this is the number of "less than 30 day" dates for each person.

Is that possible?

"Bob Phillips" wrote:

=SUMPRODUCT(--(DATE(YEAR(TODAY()),MONTH(B1:B20),DAY(B1:B20))=TO DAY()-30),
--(DATE(YEAR(TODAY()),MONTH(B1:B20),DAY(B1:B20))<=TO DAY()))

--
HTH

Bob Phillips


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How do I count differert items in a column only if the date in


"Andy D" wrote in message
...
Thanks for the quick reply Bob, but isn't this the same as doing:

=COUNTIF(B:B,""&(TODAY()-30))


No it isn't. I assuemd that you were enteriung birth days. not tjis year's
birthday, so I catered for that. And yours also includes future dates.


This does give me the number of Dates that are less than 30 days old but I
need to break this number down by the names in column A.

E.G

A B
Andy 01/Feb/2006
Andy 20/Mar/2006
Bob 04/Jan/2006
Bob 22/Mar/2006
Bob 26/Mar/2006

I would like the results to say:

Andy 1
Bob 2

As this is the number of "less than 30 day" dates for each person.


Cannot see why you would want to do that, but it's your spreadsheet

=SUMPRODUCT(--(A1:A20="Andy"),--(B1:B20=TODAY()-30),--(B1:B20<=TODAY()))


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Andy D
 
Posts: n/a
Default How do I count differert items in a column only if the date in

That's great.

One last thing, I don't know how big the columns are going to be so I would
like to set this up for the whole of A and B, is this possible?

if I change the range to A:A and B:B I get a #NUM! error (am I being thick?)


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default How do I count differert items in a column only if the date in

No you are not being thick. SUMPRODUCT works on arrays, and as such, arrays
cannot be whole columns, you have to specify the range.

Just use a range bigger than you will ever need.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Andy D" wrote in message
...
That's great.

One last thing, I don't know how big the columns are going to be so I

would
like to set this up for the whole of A and B, is this possible?

if I change the range to A:A and B:B I get a #NUM! error (am I being

thick?)


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Andy D
 
Posts: n/a
Default How do I count differert items in a column only if the date in

Bob,

Just wanted to say thanks very much for your help, my spreadsheet now does
exactly what I wanted.

Cheers
Andy


"Bob Phillips" wrote:

No you are not being thick. SUMPRODUCT works on arrays, and as such, arrays
cannot be whole columns, you have to specify the range.

Just use a range bigger than you will ever need.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Andy D" wrote in message
...
That's great.

One last thing, I don't know how big the columns are going to be so I

would
like to set this up for the whole of A and B, is this possible?

if I change the range to A:A and B:B I get a #NUM! error (am I being

thick?)



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 if date is between two dates and value in another column equ mg_sv_r Excel Worksheet Functions 2 December 6th 05 02:31 PM
match and count words David Excel Worksheet Functions 5 July 4th 05 02:24 AM
Count Position of Filtered TEXT cells in a column Sam via OfficeKB.com Excel Worksheet Functions 0 May 15th 05 08:14 PM
Count cells based on date range in another column [email protected] New Users to Excel 1 May 5th 05 08:11 PM
Count items between specific hours on a matching date KS Excel Worksheet Functions 1 December 10th 04 05:52 PM


All times are GMT +1. The time now is 10:25 PM.

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"