COUNT IF NOT EQUAL TO ZERO

G

Guest

I would like to count the number of cells in a column that does not equal
zero and then multiply each count by an adjacent number.

EG.
no of shots days per shot
6 3
0 0
3 5

i want to calculate the "days per shot" column that does not equal zero and
then multiply each count by the no. of shot. therefore 1*6+1*3 = 9.

The main problem i am having is how to count when something does not equal a
certain argument - COUNTIF NOT????

any ideas?
 
M

Max

Assuming the sample data is in A2:B4
Try: =SUMPRODUCT((A2:A4)*(B2:B4<>0))

Adapt the ranges to suit. Note that you can't use entire col references
(A:A, B:B, etc) in SUMPRODUCT
 
G

Guest

thanks - silly question but how do you inset greater than zero in a function
OR does not equal zero?

e
 
G

Guest

I have tried this and many combinations - it is not working.

do I include the & symbol and the ; symbol?

e
 
M

Max

Can you just key-in from the keyboard ?

Or try a direct copy of the formula from the post
and then paste into a cell in your sheet ?

I don't know what is not working for you ..
 
B

Bob Phillips

What &, what ;?

Do you have a continental version of Excel? If so, it would be something
like

=IF(A1>0;"Yes";"No")

& only comes in with COUNTIF/SUMIF and comparison to a cell

=SUMIF($A:$A;">"&C1,$B:$B)
 
M

Max

You're probably in deep slumber now, Bob <bg>, but when you're up ...
If the OP opens the file posted in her "continental version" of Excel, would
the formulas therein be automatically converted in terms of the commas to
semicolons, etc ? Thanks.
 
B

Bob Phillips

Hi Max,

Indeed I was, kicking out the z's.

Unfortunately, Excel is not that smart. It is the equivalent of you putting
in semi-colons, like
=IF(A1=17;A1;B1)
same error.

VBA has a strange twist. If you set a formula there, you have to use
English, like
Actyivcell.Formula = SUM(A1:A10)
and it gets translated, so German comes out as =SOMME(A1:A10). I am not sure
if you also have to use commas and it gets translated to semi-colons, I
don't have a continental version of an OS and Excel, but I doubt it as I
would have thought VBA uses the regional settings (but that is purely a
guess, and haven written has set doubt in my mind :)),.
 
M

Max

Thanks for your insights, Bob !

Guess we'll just have to take it from where the OP decides to continue or
re-join the thread discussions then (if ever) <g>. But our best efforts to
help would certainly have been given, nonetheless ..
 
B

Bob Phillips

Your comment prompts me to note how amazed I am that so many threads just
seem to tail off into nothing. How many times have you given a question as a
response, or a partial answer in the hope of getting the OP to clarify or
think more about, never to hear anymore/

Tis odd. They take the trouble to post here, but often seem to give up very
easily.

Bob
 
M

Max

.. so many threads just seem to tail off into nothing ..
.... They take the trouble to post here,
but often seem to give up very easily ..

I'll second those perceptions. And it appears there's also so many "one hit"
threads around that responders never really know whether their responses did
get through to the OPs. An amazing lack of closure ..
 

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