Is it possible to do a DCount on a the last character in a column?
Example: Suppose column A has the following data...
RGR
RARG
AGGR
GRAGA
I'd like to count the number of rows where the last character = R (The answer would be 2 in this example).
Is it possible to do a DCount on a the last character in a column?
Example: Suppose column A has the following data...
RGR
RARG
AGGR
GRAGA
I'd like to count the number of rows where the last character = R (The answer would be 2 in this example).
Sub Find_R() Dim mycell For Each mycell In Range("G1", "G500") '<-- change to suit If Right(mycell.Value, 1) = "R" Then answer = answer + 1 End If Next mycell MsgBox answer End Sub
PHP Code:
=SUMPRODUCT(--(RIGHT(A1:A4,1)="R"))
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Even better
PHP Code:
=COUNTIF(A1:A4,"*R")
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber