excel formula query

  Jeffers22 19:44 19 Oct 05
Locked

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.

J22

  VoG II 19:52 19 Oct 05

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 05

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 05

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 05

=COUNTA(D4:D10)-COUNT(D4:D10)

  Jeffers22 21:01 19 Oct 05

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

  Jeffers22 21:05 19 Oct 05

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

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

What is Amazon Go and will it come to the UK? The store without checkouts or queues

1995-2015: How technology has changed the world in 20 years

Hands-on with the Star Wars fighting drones you can fly yourself

15 macOS Sierra tips | How to use macOS Sierra: Secret tricks and best new features in Apple's new…