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!
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Hi,

Do you want the cell to show 0 or Blank if Both K35 and M35 have no value?


Book1
KLMNO
35343.5
3633
370
3844
Sheet15
Cell Formulas
RangeFormula
O35=IF(COUNT(K35,M35)<2,MAX(K35,M35),AVERAGE(K35,M35))
 
Upvote 0
Aright. The only thing is that if I do not have a value in m(or k) it is still averaging by 2. for example, if I have 10 in k, and m is blank, it is showing 5. Which I want it to show 10 or whatever the value is when there is only 1 value.
 
Upvote 0
Aright. The only thing is that if I do not have a value in m(or k) it is still averaging by 2. for example, if I have 10 in k, and m is blank, it is showing 5. Which I want it to show 10 or whatever the value is when there is only 1 value.

That Can't happen, you're going to need to show some sample data, See my samples in Post #4 and here:


Book1
KLMNQ
35343.5
3633
37
3844
391010
Sheet15
Cell Formulas
RangeFormula
Q35=CHOOSE(COUNT(K35,M35)+1,"",MAX(K35,M35),AVERAGE(K35,M35))
 
Upvote 0
When you say no value in K or M, do you have a 0 (zero) in K or M???
 
Last edited:
Upvote 0
Here is what I am talking about. If there is only a value in 1 of the cells.

in this example, I would like Q to show 10.
KLMNQ
35105
3633
37
3844
391010

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet15

Worksheet Formulas
CellFormula
Q35=CHOOSE(COUNT(K35,M35)+1,"",MAX(K35,M35),AVERAGE(K35,M35))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Well, it's showing correct results in Q36, Q37, Q38, Q39, what do you have in M35 (formula?), if so, please show that formula.
 
Upvote 0

Forum statistics

Threads
1,212,927
Messages
6,110,695
Members
448,293
Latest member
jin kazuya

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