Formula - Division based dependent on variable amount of cells filled out

jsmith70

New Member
Joined
Jul 7, 2019
Messages
12
Office Version
  1. 365
Platform
  1. Windows
Tough to word the title but basically i have 5 tables representing weeks in a month (the 1st of a month could be a friday / the 31st could fall on a tuesday).

The focus is tracking productivity of how many jobs a truck does per hour. So each table averages out for what the jobs per hour was each week. To the right i have another table for month to date to where i compare to previous year. So what i need is for the month to date total to accurately reflect if there were 5 weeks to use or 4 weeks - i have the formula obviously in there to add up all 5 cells, but if only 4 cells have data i need it to know to only divide by 4 for the average / and then of course if 5 cells have data, divide by 5.

i'm not sure if i did explain this very well - if not i can post a sample of what i have
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
figured i would add the visual example. i have 5 of these as i said for each month. so in the bottom section - there is tractor jobs / hour. daily, and then tallies weekly (utilizing the jobs and hours section. in any given month 4 or 5 of these tables could have data in them. i then need a month to date tally in a table off the right (not shown) - but i need that cell to recognize how many cells have data in them currently to know what to divide by. so if we are only 2 weeks of data into the month it divides by 2, third week it divides by 3. i presume this is pretty simple stuff relative to some of the information on this forum - and i believe i was able to do this before in a different job but cannot remember. i will search some stuff out in the meantime. appreciation to anyone that takes the time.


MonthDate RangeWeek by Week
January
MondayTuesdayWednesdayThursdayFridaySaturdayWeek
Actual hrs
55.00​
51.00​
25.00​
25.00​
25.00​
25.00​
206.00​
Big Hauls (no tractor)
3.00​
3.00​
6.00​
6.00​
6.00​
2.00​
26​
Mini Hauls
1.00​
1.00​
1.00​
1.00​
1.00​
1.00​
6​
All Jobs
6.00​
27.00​
9.00​
9.00​
9.00​
5.00​
0.03​
Jobs per Hour (all)
0.11​
0.53​
0.36​
0.36​
0.36​
0.20​
0.32​
Tractor Hours
6.00​
5.00​
5.00​
5.00​
5.00​
5.00​
31.00​
Tri Axle Hrs w/trailer
34.00​
31.00​
5.00​
5.00​
5.00​
5.00​
85.00​
Tri Axle Hours
5.00​
5.00​
5.00​
5.00​
5.00​
5.00​
30.00​
Large RO Hours
5.00​
5.00​
5.00​
5.00​
5.00​
5.00​
30.00​
Mini Hours
5.00​
5.00​
5.00​
5.00​
5.00​
5.00​
30.00​
0.00​
Tractor Jobs
1.00​
22.00​
1.00​
1.00​
1.00​
1.00​
27.00​
Tri Axle w/trailer jobs
1.00​
1.00​
1.00​
1.00​
1.00​
1.00​
6.00​
Tri Axle Comm. Jobs
1.00​
2.00​
5.00​
1.00​
1.00​
1.00​
11.00​
Large RO Jobs
2.00​
1.00​
1.00​
5.00​
5.00​
1.00​
15.00​
Mini Jobs
1.00​
1.00​
1.00​
1.00​
1.00​
1.00​
6.00​
0.00​
Tractor Jobs / HR
0.17​
4.40​
0.20​
0.20​
0.20​
0.20​
0.89​
Tri Jobs (trailer) / HR
0.03​
0.03​
0.20​
0.20​
0.20​
0.20​
0.14​
Tri Comm. Jobs / HR
0.20​
0.40​
1.00​
0.20​
0.20​
0.20​
0.37​
Large RO Jobs / HR
0.40​
0.20​
0.20​
1.00​
1.00​
0.20​
0.50​
Mini Jobs / Hour
0.20​
0.20​
0.20​
0.20​
0.20​
0.20​
0.20​
0.00​
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,608
Members
449,038
Latest member
apwr

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