Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
use "countif" function to count cells by colour | Excel Worksheet Functions | |||
Count of Suburbs - COUNTIF function? | Excel Worksheet Functions | |||
A question about the Count/CountIf function | Excel Worksheet Functions | |||
Newbe Help with count/countif function | Excel Worksheet Functions | |||
In COUNTIF function, how do I count the number of cells which con. | Excel Worksheet Functions |