ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   count if function using dates (https://www.excelbanter.com/excel-discussion-misc-queries/152817-count-if-function-using-dates.html)

Chris O''''Neill

count if function using dates
 
I have a spreadsheet the has a column of dates. I want to use count if
statements to tell me how many of the cells have a date that is less than 7
days in the past, how many of the cells have a date 7 to 30 days in the past,
how many of the cells have a date 31 to 60 days in the past, how many of the
cells have a date 61 to 90 days in the past, and how many of the cells have a
date greater than 90 days in the past. Lets say D1:D100 is the range I would
like to check. I have 5 different cells that I would like to display the five
date ranges mentioned. Please help!!!!!!

Wigi

count if function using dates
 
Hi

Use helper cells holding the date of today less 7, 31, 61, etc.

Then, to count, use:

=COUNTIF(rangeofdates,"<="&date1)-COUNTIF(rangeofdates,"<"&date2)

Here, date1 and date2 both refer to a helper cell you set up. Make sure
date2 is the larger of the 2, so marking the upper date of an interval.



--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Chris O''''Neill" wrote:

I have a spreadsheet the has a column of dates. I want to use count if
statements to tell me how many of the cells have a date that is less than 7
days in the past, how many of the cells have a date 7 to 30 days in the past,
how many of the cells have a date 31 to 60 days in the past, how many of the
cells have a date 61 to 90 days in the past, and how many of the cells have a
date greater than 90 days in the past. Lets say D1:D100 is the range I would
like to check. I have 5 different cells that I would like to display the five
date ranges mentioned. Please help!!!!!!



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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com