AVERAGE

A

Alimbilo

Need help.

I need a formula that we help me to get an average for 3 fields.

A = X
B = Y
C = Z
I want D = average of A,B,C even when one of them = 0
 
J

John W. Vinson

Need help.

I need a formula that we help me to get an average for 3 fields.

A = X
B = Y
C = Z
I want D = average of A,B,C even when one of them = 0

In the sense that the average of 5, 0, and 4 is 3? That's just the average:

D = (A + B + C) / 3

Or in the sense (invalid sense for the definition of the term) that you want
to ignore zeros?

(A + B + C) / Abs(A <> 0 + B <> 0 + C <> 0)

This will fail if ALL THREE are equal to zero.
 
A

Alimbilo

Thanks for your reply but that did not work.

Let say :

A = 2
B = 4
C = 0

The average should be 2

How can I make it happen?
 
J

John W. Vinson

Thanks for your reply but that did not work.

Let say :

A = 2
B = 4
C = 0

The average should be 2

How can I make it happen?

(A + B + C) / 3

(2 + 4 + 0) is equal to 6

6 / 3 is equal to 2

What "doesn't work"? Where are these numbers: in table fields? in VBA
variables? in form controls?

What *ACTUAL* expression are you using, and what result do you get?
 

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