Automating selecting cells to create average

Draff

New Member
Joined
Oct 11, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
First time poster here - I'm struggling to explain what I'm trying to do so excuse my fumbling. :oops:

I'm trying to create a spreedsheet to keep track of upcoming bills and work out how much I need to be puting aside each week to cover them when they hit.
The bills are weekly, some monthly, some quarterly and some yearly - they could be any time.
So the goal is to average each one out on a weekly basis starting from the previous bill, figure out each bills weekly amount, add each bills portion up to give me a total of what I need to be saving week by week.

Ive created a dummy sheet (see below) and it works, but adding new data is very time consuming to do. Each value added means re setting the range of each Average formula for each cell and I'm hoping there is a way to automate the process.

Example- For biller name "123" there is an expected bill for 1600 in week 48 (cell J2). Given this sheet starts in week 41 (C2), that means the 1600 is averaged out to be 200 per week. The value in the grey rows is the actual bill amount, while the values in the white rows is the weekly average for the bill above it.

I'm hoping there is a way to automatically finds the average value of the cells in the row above it, ranging from the last zero directly above (or to the left), until it gets to the next value grater than zero directly above or to its right.

Cell Formulas
RangeFormula
C3C3=AVERAGE(C2:J2)
D3D3=AVERAGE(C2:J2)
E3E3=AVERAGE(C2:J2)
F3F3=AVERAGE(C2:J2)
G3G3=AVERAGE(C2:J2)
H3H3=AVERAGE(C2:J2)
I3I3=AVERAGE(C2:J2)
J3J3=AVERAGE(C2:J2)
K3,M3,C5,E5,G5,I5,K5,M5K3=AVERAGE(K2:L2)
L3,N3,D5,F5,H5,J5,L5,N5L3=AVERAGE(K2:L2)
C7C7=AVERAGE(C6:G6)
D7D7=AVERAGE(C6:G6)
E7E7=AVERAGE(C6:G6)
F7F7=AVERAGE(C6:G6)
G7G7=AVERAGE(C6:G6)
H7H7=AVERAGE(H6:N6)
I7I7=AVERAGE(H6:N6)
J7J7=AVERAGE(H6:N6)
K7K7=AVERAGE(H6:N6)
L7L7=AVERAGE(H6:N6)
M7M7=AVERAGE(H6:N6)
N7N7=AVERAGE(H6:N6)
C9,C21,C19,C17,C15,C13,C11C9=AVERAGE(C8:N8)
D9,D21,D19,D17,D15,D13,D11D9=AVERAGE(C8:N8)
E9,E21,E19,E17,E15,E13,E11E9=AVERAGE(C8:N8)
F9,F21,F19,F17,F15,F13,F11F9=AVERAGE(C8:N8)
G9,G21,G19,G17,G15,G13,G11G9=AVERAGE(C8:N8)
H9,H21,H19,H17,H15,H13,H11H9=AVERAGE(C8:N8)
I9,I21,I19,I17,I15,I13,I11I9=AVERAGE(C8:N8)
J9,J21,J19,J17,J15,J13,J11J9=AVERAGE(C8:N8)
K9,K21,K19,K17,K15,K13,K11K9=AVERAGE(C8:N8)
L9,L21,L19,L17,L15,L13,L11L9=AVERAGE(C8:N8)
M9,M21,M19,M17,M15,M13,M11M9=AVERAGE(C8:N8)
N9,N21,N19,N17,N15,N13,N11N9=AVERAGE(C8:N8)
B22:B23B22=SUM(C22:N22)
C22:N23C22=SUM(C2,C4,C6,C8,C10,C12,C14,C16,C18,C20)
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Why not use the AVERAGEIF function instead? E.g. in C3 and pull right
Excel Formula:
=AVERAGEIF($C$2:$AA$2,"<>0")
(AA2 is just an example)
You then can add any values to row2 without changing the range
 
Upvote 0
No that did not work sadly 😥 .

Here is a simpler version that hopefully will explain it better.

Each bill's cycle is shown here in a colour.

As the actual sheet will be at least 70 different biller rows and around 3 years work of week columns (156), its a nightmare to copy and paste the average formula into each and every cell.

Im hoping it's possible to have a single formula that will automate.

Test spreedsheet.xlsx
ABCDEFGHIJKLMN
1W1W2W3W4W5W6W7W8W9W10W11W12W13
2Biller ABC003000001005100045
3Amount to save per week1010102020202020510151515
TEST
Cell Formulas
RangeFormula
B3,L3B3=AVERAGE(B2:D2)
C3,M3C3=AVERAGE(B2:D2)
D3,N3D3=AVERAGE(B2:D2)
E3E3=AVERAGE(E2:I2)
F3F3=AVERAGE(E2:I2)
G3G3=AVERAGE(E2:I2)
H3H3=AVERAGE(E2:I2)
I3I3=AVERAGE(E2:I2)
J3:K3J3=AVERAGE(J2)
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,174
Members
452,615
Latest member
bogeys2birdies

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