Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Need help with countif or another count function

OK, I am trying to use countif, but with more that one criteria. Is
this possible.

I have rows that have a format like this:

Letter Amt Date

I need it to count how many rows have a certain letter between certain
dates? Does anybody know how to do this?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 184
Default Need help with countif or another count function

michael, Try the followning; assuming Letter is in column 'A' and Date
is in Column 'C':

Sub LetterCount()
Dim C&, X&, cnt&
Dim myLetter As String
Dim minDate, maxDate As Date
myLetter = whatever letter
minDate = whatever date
maxDate = whatever date
C = Range(Cells(2, 1), Cells(2, 1).End(xlDown)).Rows.Count
For X = 1 To C
If Cells(X + 1, 3) = minDate Or Cells(X + 1, 3) = maxDate Then
If Cells(X + 1, 1) = myLetter Then
cnt = cnt + 1
End If
End If
Next X
MsgBox "The letter """ & myLetter & """ appears in " & cnt & " rows."
End Sub

HTH--Lonnie M.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 339
Default Need help with countif or another count function


wrote in message
oups.com...
OK, I am trying to use countif, but with more that one criteria. Is
this possible.

I have rows that have a format like this:

Letter Amt Date

I need it to count how many rows have a certain letter between certain
dates? Does anybody know how to do this?


I have found an article that mentions countif with more than one criteria
he http://www.mrexcel.com/td0128.html
I don't know how to deal with the dates, though. It must be possible to get
date as a number, right. In that case, this article will get you started.

/Fredrik


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Need help with countif or another count function

Worksheet functions okay?

=SUMPRODUCT(--(A1:A1000,"A"),--(C1:C1000=--"2004-01-01"),--(C1:C1000<=--"20
04-01-20"))

--

HTH

RP
(remove nothere from the email address if mailing direct)


wrote in message
oups.com...
OK, I am trying to use countif, but with more that one criteria. Is
this possible.

I have rows that have a format like this:

Letter Amt Date

I need it to count how many rows have a certain letter between certain
dates? Does anybody know how to do this?



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Need help with countif or another count function

That formula isn't applicable in this case. It is for a range of values
within a single column. This problem involves criteria against two columns.
Countif doesn't work in that situation.

Bob Phillips has posted an Array formula (SumProduct) which does it.

--
Regards,
Tom Ogilvy

"Fredrik Wahlgren" wrote in message
...

wrote in message
oups.com...
OK, I am trying to use countif, but with more that one criteria. Is
this possible.

I have rows that have a format like this:

Letter Amt Date

I need it to count how many rows have a certain letter between certain
dates? Does anybody know how to do this?


I have found an article that mentions countif with more than one criteria
he http://www.mrexcel.com/td0128.html
I don't know how to deal with the dates, though. It must be possible to

get
date as a number, right. In that case, this article will get you started.

/Fredrik




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
use "countif" function to count cells by colour ken Excel Worksheet Functions 1 December 12th 07 08:22 AM
Count of Suburbs - COUNTIF function? Lyndon Excel Worksheet Functions 2 February 10th 07 12:43 AM
A question about the Count/CountIf function Carl Excel Worksheet Functions 3 January 12th 07 09:10 AM
Newbe Help with count/countif function Cybertech Excel Worksheet Functions 5 August 24th 05 03:48 AM
In COUNTIF function, how do I count the number of cells which con. CiCi Bird Excel Worksheet Functions 4 January 12th 05 08:06 PM


All times are GMT +1. The time now is 04:19 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"