Average, excluding zeros, non-contiguous range

ramswin

New Member
Joined
Mar 3, 2022
Messages
4
Office Version
  1. 365
Platform
  1. Windows
1646332428081.png

Hi, I am trying to find the average of this row (skipping the greyed columns-- so skipping columns F,G,M,N) and also excluding the zeros (columns H to L). I know the AverageIf cannot skip columns so that didn't work, please help. Please assist. Thank you!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi & welcome to MrExcel.
Are you trying to ignore weekends & if do is row 1 actual dates formatted to show m/d?
 
Upvote 0
Yes, correct. Trying to ignore weekends and row 1 is the date.
 
Upvote 0
Ok, how about
Excel Formula:
=AVERAGE(FILTER(B2:S2,(B2:S2<>0)*(WEEKDAY($B$1:$S$1,2)<6)))
 
Upvote 0
That worked! Thank you, couple questions:
1. what does the 2 and the <6 represent?
2. for the weekends I'm assuming just replace Weekday with Weekend?
3. How would I do this if there weren't any dates?

Thanks for the quick help!
 
Upvote 0
1) the 2 stipulates that Monday is 1 Tuesday is 2 etc, so the <6 returns columns that are before Saturday.
2) No you would >5 rather than <6
3) You need some criteria to determine which cells to exclude.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,938
Messages
6,122,346
Members
449,080
Latest member
Armadillos

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