Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AVERAGEIF question for Excel Experts 2

Status
Not open for further replies.

TomSalvato

Technical User
Mar 24, 2010
64
US
Hello all,

I think what I'm trying to do is pretty straight forward, but I'm no excel expert (sadly).

I have three columns, I want the average of the contents, depending on how many columns are greater than zero.
So, if two of the three cells are greater than 0, I want to divide by 2. If only one of the three cells is greater than zero, then divide by 1. And if all three cells are greater than zero, divide by 3.

cell 1 cell 2 cell 3 formula result
4,524.69 1,047.38 875.61 2,149.23
1,293.62 577.08 0 935.34
0 612.02 0 612.02

Any help would be greatly appreciated!

-TS
 
[pre]
A B C D
cell 1 cell 2 cell 3 Formula
4,524.69 1,047.38 875.61 [red]=AVERAGEIF(A2:C2, "<>0")[/red]
1,293.62 577.08 0 [red]=AVERAGEIF(A3:C3, "<>0")[/red]
0 612.02 0 [red]=AVERAGEIF(A4:C4, "<>0")[/red][/pre]

More about AVERAGEIF here

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson
 
Perfect! Exactly what I was looking for.
Thanks, Andrzejek!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top