Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 49975

COUNTIF with 2 Conditions met UNTIL 2 Condition met

$
0
0
Hello, this is my first post to the forum. Thank you in advance for any help you can give me.

I'm coding with VBA

Tables and Formula provided are for reference only.

What I need is to count the Cells in Column C that are greater than 1 For Items PName and ANAME(X,Y,Z).
My problem is that my number of rows for each ANAME(X,Y,Z) will vary and are NOT always in the same range/cell reference.
(e.g ANAMEX may be in spot where ANAMEZ is and vise-versa).

Something like COUNTIF/UNTIL code. Maybe?

The folowing EXAMPLE works IF my references were constant, but they are not.

Formula:
=IF(A1="PName",IF(ISERROR(FIND(B1,"X",1))=TRUE,COUNTIF(C3:C7,">1"),""),"")


Column A
Column B
Column C
PName
ANAMEX
#'s
Text
10
#'s
Text
10
#'s
Text
10
#'s
Text
10
#'s
Text
10
PName
ANAMEY
#'s
Text
10
#'s
Text
10
#'s
Text
10
#'s
Text
10
#'s
Text
10
PName
ANAMEZ
#'s
Text
10
#'s
Text
10
#'s
Text
10
#'s
Text
10
#'s
Text
10

Totals Area

Column E
Column F
Row 2
X
Should Count to 5
Row 3
Y
Should Count to 5
Row 4
Z
Should Count to 5

I hope I explained myself properly. Thank you.

Viewing all articles
Browse latest Browse all 49975

Trending Articles