Average If - Different Cells

JustOneQuestion

New Member
Joined
Jul 5, 2016
Messages
19
Hi all,

I am trying to average 2 cells (k35 and m35) if the cell value is greater than 0. Those 2 cells are an average of the column. I want the equation to average both cells if there is a value in the cells, if not, just display one or the other cell value.

The issue that I am running into is if there is not a value in m35 (or k35) it still is averaging, so it is showing an incorrect value because it is dividing the number by 2.

Here is the old formula that I have been using, but I added a column in the middle, so I can no longer use the K35:L35.

=IFERROR(AVERAGEIF(K35:L35,">0"),0)

Any thoughts?

Thank you!
 
Sorry about that. I just copied your example and left the numbers in there.

here is the corrected version with the formula you provided in Q35

KLMNQ
351005

<tbody>
</tbody>

 
Upvote 0

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Last edited:
Upvote 0
Ok, this will work whether you have 0 value in the cells Or if they're Blank, let me know if it works.


Book1
KLMNO
35343.5
36303
3700
38044
3910010
4033
4144
42
431010
441010
Sheet15
Cell Formulas
RangeFormula
O35=IF(AND(K35=0,M35=0),"",IF(OR(K35=0,M35=0),MAX(K35,M35),AVERAGE(K35,M35)))
 
Upvote 0
You're welcome.

FYI, having a 0 (zero) in a cell does Not mean there's no value in the cell (Nor does it mean the cell is Blank), a 0 is a Valid value for mathematical purposes and will be included as such.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top