Calculate average headcount YTD

erniepoe

Active Member
Joined
Oct 23, 2006
Messages
375
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Am trying to calculate average headcount YTD based on the month selected from the dropdown. Cell A4 is where the month is listed, and C2:N2 is January-December, and then row 3 is the headcount for that month.

I want the average headcount YTD, but not if the headcount is 0 in any month. The offset portion of this formula works before changing the average to averageif and selecting each monthly headcount (and adding the ,0 and the end), but the below formula fails.

Any idea what I am doing wrong?


AVERAGEIF(Headcount!C3:N3,">0",(OFFSET(Headcount!C3,0,0,1,MATCH(A4,Headcount!C2:N2,0))),0)
 
Last edited:

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Perhaps:

Excel Formula:
=AVERAGEIFS(OFFSET(Headcount!C3,0,0,1,MATCH(A4,Headcount!C2:N2,0)),OFFSET(Headcount!C3,0,0,1,MATCH(A4,Headcount!C2:N2,0)),">0")
 
Upvote 0

Forum statistics

Threads
1,215,454
Messages
6,124,933
Members
449,195
Latest member
Stevenciu

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