View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
RB Smissaert RB Smissaert is offline
external usenet poster
 
Posts: 2,452
Default combine CountA and CountIf

In the example it was cells H4.
Not figured this out yet.

What I am trying to do is this:
In a sheet is data with repeating columns in groups of 3 like this:
Term, Date, Value, Term, Date, Value etc.
The only way to see how far to the right this goes is by looking at fields,
which are in row 2.
This is the 3Test_3 bit.
If in one row there are more than one of the Term, Date, Value groups I need
to take the last Value
(the one most to the right) and take of the Value in the group to the left
of that.
So for example if I have:
44P.., 05/10/2005, 10, 44P.., 05/10/2006, 8
The result would be 2 (10 - 8)
More complex than I thought, but I will figure it out.

RBS

"RB Smissaert" wrote in message
...
There still is a problem and that is caused by circular references.
My formula will have to look like this:

=IF(COUNTA(OFFSET(I4,0,0,1,COUNTIF($3:$3,"3Test_3* ")))<
4,"NA",OFFSET(H4,0,COUNTA(OFFSET(I4,0,0,1,COUNTIF( $3:$3,"3Test_3*")))) -
OFFSET(H4,0,COUNTA(OFFSET(I4,0,0,1,COUNTIF($3:$3," 3Test_3*")))-3))

Not sure what construction I need to avoid an error message. Have tried
with and If(IsError( construction, but
that still has the same problem.

RBS


"Tom Ogilvy" wrote in message
...
=CountA(offset(A7,0,0,1,COUNTIF($2:$2,"3Morb_3*"))


--
Regards,
Tom Ogilvy


"RB Smissaert" wrote in message
...
How in a worksheet formula would I combine these 2:

=COUNTIF($2:$2,"3Morb_3*")
and
=COUNTA(A7:E7)

where the result of the first formula would provide the column number
for the second formula?

So, if the first formula produced 5 the second one would be right.


RBS