NA() and COUNTIF functions together?

Joined
Jun 8, 2010
Messages
2
Reaction score
0
Hi everyone,

Here is what I need to do:

If cells AS2:AS4 are either blank or filled with zeros, I want cell AS6 to display #N/A. I can do this using this function: =IF(SUM(AS2:AS4),0,"#N/A")

however, if cells AS2:AS4 are not blank, I want to count the cells that contain a value of 2 and display the total in cell AS6, which I can do using this function: =COUNTIF(AS2:AS4,"2")

What I don't know is how to get both functions to work simultaneously. Can anyone help?

Thanks!
Amanda
 
Last edited:
Joined
Jun 8, 2010
Messages
2
Reaction score
0
I really need some help because this is creating a roadblock in my productivity!

I have been racking my brain all morning and came up with this:
=IF(SUM(AL2:AL4=0),"#N/A",(COUNTIF(AL2:AL4,"2")))

It doesn't work either. I get a #VALUE error no matter what.
 

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