Average across multiple worksheets excluding unfilled cells

Dbldoc

New Member
Joined
Oct 5, 2024
Messages
2
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have a workbook consisting of 12 worksheets that represent the months of the year. Each worksheet contains columns representing the days of the week with each day consisting of two adjacent columns (i.e. AB, CD, etc.). The rows to the left of the columns list numerous objects, and each day I manually input data into the two columns that reflect the number of each object sold and the total amount of revenue received from that sale of those objects. At the bottom of each column there is a sum for the total number of objects sold and the total amount of revenue for the day. Not every object is sold each day. I have spent hours trying to devise a formula which will give me the average daily number of sales and the average daily revenue in a running fashion during the month when the formula includes blank cells from future days for which no data currently exists. AVERAGEIF does not work across multiple sheets, and other formulas I have tried including INDEX(FREQUENCY) seem to include the blank cells of future days which filters the average for the month to date data. Any help appreciated, thanks.
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
I would suggest that you post a small sample of the data, along with the actual expected results.

Also, when posting data, please don't post an image of the data. You can either simply copy and paste the data as text, or better yet use the XL2BB add-in.

Cheers!
 
Upvote 0
Thank you. I've uploaded a copy of the worksheet in progress which includes one month, “Jul ‘24”, although eventually will include all 12 months. Sample data added to the “Jul ‘24” sheet. The organization and layout of the worksheet for each month is the same. Data is entered into the “#” column for each day of the week with formulas in the “# RVU’s” column and “Daily Totals” section automatically calculating certain data. Not every row will have data entered each day. The problem I’ve encountered is trying to have running averages in the “Monthly Totals” for the month section (the cells with black fill color and white font in the blue and green sections) that only include the data for days up to and including the current day. The formula in these sections in the “Jul ‘24” sheet averages across all columns including those that have no data yet entered. Eventually I would also like a Yearly Average of certain data as a 13th sheet, averaging the same cell across all 12 (monthly) sheets but encountered the same problem i.e. the averages all months including those with no data yet entered, which skewed the data for previous and current months.

xl2bb.xlsm
BCDEFGHIJKLMNOPQ
1OVERNIGHT DATAMOONLIGHTING
2Mon 7/1/24Tue 7/2/24Wed 7/3/24Thu 7/4/24
3RVUProcedure## RVU's## RVU's## RVU's## RVU's## RVU's## RVU's
41.82CT Abd/ Pelvis w Contrast  47.28   
51.74 CT Abd/Pelvis Oral only23.48     
62.01CT Abd/Pelvis w/wo     510.05 
71.74CT Abd/Pelvis w/o  35.22    
81.00CT Extremity Lower w      
91.16CT Extremity Lower Bilateral w/22.32     
101.70CT Head/ Face23.40   58.50 
112.13CT Head/Orbits      
121.27Ct head/brain w/o & w/ 33.81    
131.38CT Neck with22.76     
141.28CT Neck w/o  45.12   
151.75CTA Neck 35.25    
163.50CTA stroke (H&N)      
171.78Mri Brain w23.56     
182.29Mri Brain w/ & w/o      
191.48Mri Cervical spine wo  45.92   
201.48Mri Lumbar spine    57.40 
210.59US Gallbladder RUQ21.18     
220.99US OB >=14 wk 32.97    
230.99US Pelvis Pregnancy 1st Tri < 12 wks  43.96   
241.80US Scrotum23.60     
250.56US Thyroid      
260.45US Venous Duplex UE - UC      
270.16Xrays (total)20.3230.4840.64 50.8 
28IR37.00
29
30DAILY TOTALS## RVU's## RVU's## RVU's## RVU's## RVU's## RVU's
31CT Body45.8035.2247.28  CT Body510.05  
32CT Neuro46.1669.0645.12  CT Neuro58.50  
33Total CT811.96914.28812.40  Total CT1018.55  
34Total MRI23.56  45.92  Total MRI57.40  
35Total US44.7832.9743.96  Total US    
36Total XR20.3230.4840.64  Total XR50.80  
37Total IRTotal IR37.00  
38Σ1620.621517.732022.92  Σ2333.75  
39Average RVU/Body CT1.451.741.82 Average RVU/Body CT2.01 
40Average RVU/Neuro CT1.541.511.28 Average RVU/Neuro CT1.70 
41Average RVU/All CT1.501.591.55 Average RVU/All CT1.86 
42Average RVU/Mri1.78 1.48 Average RVU/Mri1.48 
43Average RVU/US1.200.990.99 Average RVU/US  
44% Body CT of total CT50%48%33%37%50%59%  % Body CT of total CT50%54%  
45% Body CT of total studies25%28%20%81%20%54%  % Body CT of total studies22%30%  
46% Neuro CT of total CT50%52%67%63%50%41%  % Neuro CT of total CT50%46%  
47% Neuro CT of total studies25%30%40%51%20%22%  % Neuro CT of total studies22%25%  
48% US25%23%20%17%20%17%  % US    
49% Xray13%2%20%3%20%3%  % Xray22%2%  
50% IR        % IR13%21%  
51
52
53MONTHLY TOTALS (NIGHTS)Nights## RVU'sMONTHLY TOTALS (MOONLIGHTING)Moonlight## RVU's
54CT Body1118.30CT Body510.05
55CT Neuro1420.34CT Neuro58.50
56Total CT2538.64Total CT1018.55
57Total MRI69.48Total MRI57.40
58Total US1111.71Total US  
59Total XR91.44Total XR50.80
60Total IRTotal IR37.00
61Σ5161.27Σ2333.75
62Average RVU/studyAverage RVU/study
63Body CT1.66Body CT2.01
64Neuro CT0.69Neuro CT1.70
65All CT1.55All CT1.86
66Mri1.58Mri1.48
67US1.06US 
68Xray0.16Xray0.16
69IRIR2.33
70% of Total CT## RVU's% of Total CT## RVU's
71Body CT44%47%Body CT50%54%
72Neuro CT56%53%Neuro CT50%46%
73% of All Studies## RVU's% of All Studies## RVU's
74Body CT22%30%Body CT22%30%
75Neuro CT27%33%Neuro CT22%25%
76All CT49%63%All CT43%55%
77% MRI12%15%% MRI22%22%
78% US22%19%% US  
79% Xray18%2%% Xray22%2%
80% IR% IR13%21%
81Averages per Night Shift Entire Month## RVU'sAverages per ML Shift Entire Month## RVU's
82CT Body2.754.58CT Body
83CT Neuro45.09CT Neuro
84Total CT69.66Total CT
85Total MRI22.37Total MRI
86Total US32.93Total US
87Total XR20.36Total XR
Jul '24
Cell Formulas
RangeFormula
B11B11=0.85+1.28
E4:E27,Q4:Q27,O4:O27,K4:K27,I4:I27,G4:G27E4=D4*$B4
D31,F31,H31,J31,N31:Q31D31=SumByColor(D4:D16,$A$35)
E31,G31,I31,K31E31=SumByColor(E4:E16,$A$44)
D32,F32,H32,J32,N32:Q32D32=SumByColor(D4:D16,$A$36)
E32,G32,I32,K32E32=SumByColor(E4:E16,$A$45)
D33:K33,N56:O56,D56:E56,N33:Q33D33=SUM(D31:D32)
D34,F34,H34,J34,N34,P34D34=SumByColor(D4:D20,$A$37)
E34,G34,I34,K34,O34,Q34E34=SumByColor(E4:E20,$A$46)
D35,F35,H35,J35,N35:Q35D35=SumByColor(D21:D26,$A$38)
E35,G35,I35,K35E35=SumByColor(E21:E26,$A$47)
D36,F36,H36,J36,N36,P36D36=SumByColor(D27,$A$39)
E36,G36,I36,K36,O36,Q36E36=SumByColor(E27,$A$48)
N37:Q37N37=N28
N38:Q38,N61:O61,D38:K38N38=SUM(N33:N37)
N39:N43,P39:P43,D39:D43,F39:F43,H39:H43,J39:J43N39=IF(O31,O31/N31,"")
N44:Q44,N49:Q49,D44:K44,D49:K49N44=IF(N31,N31/N33,"")
N45:P45,D45:F45,H45,J45N45=IF(N31,N31/N38,"")
Q45,G45,I45,K45Q45=IF(Q31,Q33/Q38,"")
N46:Q46,D46:K46N46=IF(N32,N32/N33,"")
N47:Q47,D47:K47N47=IF(N32,N32/N38,"")
N48:Q48,D48:K48N48=IF(N35,N35/N38,"")
N50:Q50,D50:K50N50=IF(N37,N37/N38,"")
D54:D55D54=SumByColor(D31:K31,A35)
E54:E55E54=SumByColor(D31:K31,A44)
D57:D59D57=SumByColor(D34:K34,A37)
E57:E59E57=SumByColor(E34:K34,A46)
N54:N55N54=SumByColor(N31:Q31,A35)
O54:O55O54=SumByColor(N31:Q31,A44)
N57:N58N57=SumByColor(N34:Q34,A37)
O57:O60O57=SumByColor(N34:Q34,A46)
N59:N60N59=SumByColor(N27:Q27,A39)
D61:E61D61=SUM(D56:D59)
D63,D65:D67D63=IF(E54,E54/D54,"")
D64D64=IF(D55,D55/E55,"")
D68,N63:N69D68=IF(D59,E59/D59,"")
D71:E71,N71:O71D71=IF(D54,D54/D56,"")
D72:E72,N72:O72D72=IF(D55,D55/D56,"")
D74:E74,N74:O74D74=IF(D54,D54/D61,"")
D75:E75,N75:O75D75=IF(D55,D55/D61,"")
D76:E76,N76:O76D76=IF(D56,D56/D61,"")
D77:E77,N77:O77D77=IF(D57,D57/D61,"")
D78:E78,N78:O78D78=IF(D58,D58/D61,"")
D79:E79,N79:O79D79=IF(D59,D59/D61,"")
N80:O80N80=IF(N60,N60/N61,"")
D82:D83D82=SumByColor(D31:K31,A35)/CountColour(D31:K31,A35)
E82:E83E82=SumByColor(D31:K31,A44)/CountColour(D31:K31,A44)
D84D84=SumByColor(D33:K33,A41)/CountColour(D33:K33,A41)
E84E84=SumByColor(D33:K33,A50)/CountColour(D33:K33,A50)
D85:D87D85=SumByColor(D34:K34,A37)/CountColour(D34:K34,A37)
E85:E87E85=SumByColor(D34:K34,A46)/CountColour(D34:K34,A46)
 
Upvote 0
I'm not sure I quite understand. If you simply want to average a single cell across multiple worksheets, try...

Excel Formula:
=AVERAGE('Jul ''24:Jun ''25'!B2)

Note that the formula will ignore blank cells. However, if your other sheets don't already exist, you'll get an error. In this case, I would suggest that you create two new worksheets, and name them First and Last. Then place any and all of the relevant sheets between those two new worksheets. Now those sheets, and any other ones that you place there in the future, will be taken into consideration by the following formula...

Excel Formula:
=AVERAGE(First:Last!B2)

Does this help? If not, can you please elaborate?
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

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