How do you ignore zeros when averaging data not next to each other.

Nothnless

Board Regular
Joined
Apr 28, 2016
Messages
142
Hi, I know this works =AVERAGEIF(A2:G2,"<>0")

But how do I do the same thing if I only want to look at values in specific columns? A2, D2, G2, assuming there are other numbers I don't want included in the average in between these columns.
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Would you ever be excluding A2, D2, and G2 if one of those was zero?
If not, one way is to do averages the old fashioned way, i.e.
=(A2+D2+G2)/3
 
Upvote 0
Hi, Yes.

I found my answer but thanks for the help.

Note to future self: =(A2+D2+G2) / ((A2<>0)+(D2<>0)+(G2<>0))
 
Upvote 0
Hi, Yes.

I found my answer but thanks for the help.

Note to future self: =(A2+D2+G2) / ((A2<>0)+(D2<>0)+(G2<>0))
Ah, OK. I wasn't sure if these zeroes where in those columns, or the other columns you didn't want to include.
Glad you got it figured out.
 
Upvote 0

Forum statistics

Threads
1,215,220
Messages
6,123,694
Members
449,117
Latest member
Aaagu

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