excel formula query

  Jeffers22 19:44 19 Oct 2005

Seems simple, but the excel count formula says the COUNT function is only for where there is a number in a cell.

What I want to do is get a total number of cells within a range that have any letter in them. But, I want to look only at every second cell in a row starting from D4. So D4 D6 D8 D10 etc.

This has me stumped, probably not looking hard enough. Hope someone can help.


  VoG II 19:52 19 Oct 2005

You need to use the COUNTA function.

But I don't know how to only look at every other row without coding in VBA.

  VoG II 19:57 19 Oct 2005

Sub countother()

Dim iRow, kount

kount = 0

For iRow = 4 To 10 Step 2

If Range("D" & iRow).Value <> "" Then kount = kount + 1

Next iRow

MsgBox kount

End Sub

  Jeffers22 20:02 19 Oct 2005

Thanks for that. Hmmmm

OK. Every other cell will contain a number, can I do a countif = L or B or N or C or B ? - there are only about 6 possible letters in "every other cell"

  VoG II 20:12 19 Oct 2005


  Jeffers22 21:01 19 Oct 2005

Thanks, that looks like the ticket. I'll try it and post back

  Jeffers22 21:05 19 Oct 2005

Vog, a thousand thanks. That is spot on - and gives the correct result.

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

Alienware 17 R4 2017 review

These brilliant Lego posters show just what children's imaginations are capable of

Mac power user tips and hidden tricks

Comment réinitialiser votre PC, ordinateur portable ou tablette Windows ?