#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Count function

Attempting to obtain a count on the number of records with values populated
in a particular field that are between a date range. Have tried the
different count functions and cannot seem to get this to work. Any ideas on
how best to approach this?
John

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Count function

Count how may are above the first cut-off date, subtract how many are over
the second cut-off date
=COUNTIF(rng,""&DATE(yyyy1,mm1,dd1)) - COUNTIF(rng,"<"&DATE(yyyy2,mm2,dd2))

If using Excel 2007, you could use COUNTIFS
=COUNTIF(rng,""&DATE(yyyy1,mm1,dd1)),"<"&DATE(yyy y2,mm2,dd2))

In any version use SUMPRODUCT

=SUMPRODUCT(--(A1:A200DATE(yyyy1,mm1,dd1)), --(A1:A20<DATE(yyyy2,mm2,dd2)))
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"John Peterson" <John wrote in message
...
Attempting to obtain a count on the number of records with values
populated
in a particular field that are between a date range. Have tried the
different count functions and cannot seem to get this to work. Any ideas
on
how best to approach this?
John



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default Count function

One way:

pre-XL07:

=SUMPRODUCT(--(A1:A100=DATE(2008,1,1)),
--(A1:A100<=DATE(2008,12,31)), --ISNUMBER(B1:B100))


XL07,ff:

=COUNTIFS(A:A,"=1/1/2008",A:A,"<=12/31/2008")


In article ,
John Peterson <John wrote:

Attempting to obtain a count on the number of records with values populated
in a particular field that are between a date range. Have tried the
different count functions and cannot seem to get this to work. Any ideas on
how best to approach this?
John

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/and function? tonyalt3 Excel Worksheet Functions 6 March 25th 08 09:26 PM
function to use to count value Rae Excel Worksheet Functions 9 February 27th 08 06:36 PM
Count function MarekZ Excel Worksheet Functions 5 July 23rd 07 11:59 PM
i think i need count function help monkeytrader Excel Worksheet Functions 1 May 9th 07 05:38 PM
Count Function Help Josh O. Excel Worksheet Functions 4 July 29th 05 11:04 PM


All times are GMT +1. The time now is 01:30 AM.

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"