How to count a varying range

D

davegb

I have a spreadsheet that logs letters I send out to various agencies.
Each time I add a letter to the log, I use a macro which creates a new
line at the top of the log in row 3 so newest letters are at the top.
In column A is the index number of the letter which is simply 1 added
to the previous index no. In column G is a status indicator, either an
"F" or an "N".

I want to count the Fs in column G and divide by the total number of
letters. The total is there in A3. The following formula works fine,
until I add a new row:
=COUNTIF(INDIRECT("G3:G" & A3+2),"F")/A3

When I add a new row, the "G3", and both "A3"s increment to G4 and A4
respectively, and the formula omits row 3 from the count. As I add
more lines, the new lines are not included in the count. I'd like to
know how to get around this problem. I've tried several combinations
to make the 3 a constant, one of which is:
=COUNTIF(INDIRECT("G"&"3:G"&"a"&"3"+2),"f")/"a"&"3"

but it returns a #REF or sometimes a #VALUE error.
Does anyone know how to write this formula so it works?
Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top