# I need help with and average formula

#### Hey_Edrey

##### New Member
I'm trying to see if there is a way to get an average of three cells but in some cases one or two of the 3 cells will be zero and I want it to average accordingly to the amount of cells with a value in them for example:

150 , 154 , 140 = 148 this gets divided by 3 values entered

150 , 154 , 0 = 101 this gets divided by 3 values but there are only two entered, I need it to divide by 2 only

150 , 0 , 0 = 50 should be 150 if divided by only 1 value entered

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Welcome to the Board!

How's this:

=SUM(A3:C3)/COUNTIF(A3:C3,">0")

What if you get negative numbers?

Hope that helps,

Smitty

Thaks that is exactly what I needed

Replies
3
Views
271
Replies
10
Views
360
Replies
14
Views
621
Replies
5
Views
313
Replies
5
Views
282

1,211,744
Messages
6,103,670
Members
447,876
Latest member
rodqntr

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back