Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=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 (remove nothere from email address if mailing direct) "Andy D" <Andy wrote in message ... 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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]() "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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Count if date is between two dates and value in another column equ | Excel Worksheet Functions | |||
match and count words | Excel Worksheet Functions | |||
Count Position of Filtered TEXT cells in a column | Excel Worksheet Functions | |||
Count cells based on date range in another column | New Users to Excel | |||
Count items between specific hours on a matching date | Excel Worksheet Functions |