To count fields in a table using some conditions

I want create an application to calculate the one table fields, by condition null or not null and also by the values.
At moment, I created a grid application. I put a count sentence in every field that i need to calculate. Also I used group by sentence. But with this I just get the number of the fields which are not null.
How can I do this?
Any idea?

Thanks