Running Totals

itsgrady

Board Regular
Joined
Sep 11, 2022
Messages
115
Office Version
  1. 2021
Platform
  1. Windows
  2. MacOS
I have a spreadsheet with days of the week as the header for each column.

What I would like to do is use the last column (7th column) for current information. The seventh column will always be the current date - the other 6 columns will be the previous days.

The next day I would like for all data move over to the left and the oldest day roll off the form. So, the current 7 days will always be on the form.

Is there an easy formula to move everything over each day. I was thinking to use a button with VBA code, unless there is an easier way.

Thanks for the help.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
I'd store all the data in some TABLE somewhere and just show the last seven days.

In K2 I use today. But I might also use what is in K1 for that instead.
MrExcelPlayground14.xlsx
ABCDEFGHIJK
1DateValueTue 12/13/2022
211/15/202286DayWed 12/7/2022Thu 12/8/2022Fri 12/9/2022Sat 12/10/2022Sun 12/11/2022Mon 12/12/2022Tue 12/13/2022
311/16/202270Value90811620114090
411/17/202211
511/18/202223
611/19/202279
711/20/202289
811/21/202262
911/22/202266
1011/23/202288
1111/24/202260
1211/25/202299
1311/26/202277
1411/27/202275
1511/28/202261
1611/29/202291
1711/30/202293
1812/1/202257
1912/2/202214
2012/3/202276
2112/4/202279
2212/5/202272
2312/6/202240
2412/7/202290
2512/8/202281
2612/9/202216
2712/10/202220
2812/11/202211
2912/12/202240
3012/13/202290
Sheet28
Cell Formulas
RangeFormula
K1K1=MAX(Table3[Date])
E2:J2E2=F2-1
K2K2=TODAY()
E3:K3E3=XLOOKUP(E2,Table3[[Date]:[Date]],Table3[[Value]:[Value]],"",0)
 
Upvote 0
I'd store all the data in some TABLE somewhere and just show the last seven days.

In K2 I use today. But I might also use what is in K1 for that instead.
MrExcelPlayground14.xlsx
ABCDEFGHIJK
1DateValueTue 12/13/2022
211/15/202286DayWed 12/7/2022Thu 12/8/2022Fri 12/9/2022Sat 12/10/2022Sun 12/11/2022Mon 12/12/2022Tue 12/13/2022
311/16/202270Value90811620114090
411/17/202211
511/18/202223
611/19/202279
711/20/202289
811/21/202262
911/22/202266
1011/23/202288
1111/24/202260
1211/25/202299
1311/26/202277
1411/27/202275
1511/28/202261
1611/29/202291
1711/30/202293
1812/1/202257
1912/2/202214
2012/3/202276
2112/4/202279
2212/5/202272
2312/6/202240
2412/7/202290
2512/8/202281
2612/9/202216
2712/10/202220
2812/11/202211
2912/12/202240
3012/13/202290
Sheet28
Cell Formulas
RangeFormula
K1K1=MAX(Table3[Date])
E2:J2E2=F2-1
K2K2=TODAY()
E3:K3E3=XLOOKUP(E2,Table3[[Date]:[Date]],Table3[[Value]:[Value]],"",0)
I like that suggestion very much. Now, each column has 15 rows of data. Is there a formula to copy the row of information to each column since the dates are on the left column.
 
Upvote 0
This should do the trick - I made it for four columns of data

MrExcelPlayground14.xlsx
ABCDEFGHIJKLMNO
1DateValueThingElseButWed 12/14/2022
211/15/20228688176126DayThu 12/8/2022Fri 12/9/2022Sat 12/10/2022Sun 12/11/2022Mon 12/12/2022Tue 12/13/2022Wed 12/14/2022
311/16/2022707214494Value81162011409050
411/17/2022111326-24Thing83182213429252
511/18/20222325500Else16636442684184104
611/19/20227981162112But116-14-6-243413454
711/20/20228991182132
811/21/2022626412878
911/22/2022666813686
1011/23/20228890180130
1111/24/2022606212474
1211/25/202299101202152
1311/26/20227779158108
1411/27/20227577154104
1511/28/2022616312676
1611/29/20229193186136
1711/30/20229395190140
1812/1/2022575911868
1912/2/2022141632-18
2012/3/20227678156106
2112/4/20227981162112
2212/5/2022727414898
2312/6/202240428434
2412/7/20229092184134
2512/8/20228183166116
2612/9/2022161836-14
2712/10/2022202244-6
2812/11/2022111326-24
2912/12/202240428434
3012/13/20229092184134
3112/14/2022505210454
Sheet28
Cell Formulas
RangeFormula
O1O1=MAX(Table3[Date])
C2:C31C2=[@Value]+2
D2:D31D2=[@Thing]*2
E2:E31E2=[@Else]-50
I2:N2I2=J2-1
O2O2=TODAY()
I3:O6I3=TRANSPOSE(XLOOKUP(I2,Table3[[Date]:[Date]],Table3[[Value]:[But]],"",0))
Dynamic array formulas.
 
Upvote 0
This should do the trick - I made it for four columns of data

MrExcelPlayground14.xlsx
ABCDEFGHIJKLMNO
1DateValueThingElseButWed 12/14/2022
211/15/20228688176126DayThu 12/8/2022Fri 12/9/2022Sat 12/10/2022Sun 12/11/2022Mon 12/12/2022Tue 12/13/2022Wed 12/14/2022
311/16/2022707214494Value81162011409050
411/17/2022111326-24Thing83182213429252
511/18/20222325500Else16636442684184104
611/19/20227981162112But116-14-6-243413454
711/20/20228991182132
811/21/2022626412878
911/22/2022666813686
1011/23/20228890180130
1111/24/2022606212474
1211/25/202299101202152
1311/26/20227779158108
1411/27/20227577154104
1511/28/2022616312676
1611/29/20229193186136
1711/30/20229395190140
1812/1/2022575911868
1912/2/2022141632-18
2012/3/20227678156106
2112/4/20227981162112
2212/5/2022727414898
2312/6/202240428434
2412/7/20229092184134
2512/8/20228183166116
2612/9/2022161836-14
2712/10/2022202244-6
2812/11/2022111326-24
2912/12/202240428434
3012/13/20229092184134
3112/14/2022505210454
Sheet28
Cell Formulas
RangeFormula
O1O1=MAX(Table3[Date])
C2:C31C2=[@Value]+2
D2:D31D2=[@Thing]*2
E2:E31E2=[@Else]-50
I2:N2I2=J2-1
O2O2=TODAY()
I3:O6I3=TRANSPOSE(XLOOKUP(I2,Table3[[Date]:[Date]],Table3[[Value]:[But]],"",0))
Dynamic array formulas.

I really appreciate the help on this project... Your way is a lot better because it keeps an history on a table. Thank you so much! Merry Christmas!
 
Upvote 0
This should do the trick - I made it for four columns of data

MrExcelPlayground14.xlsx
ABCDEFGHIJKLMNO
1DateValueThingElseButWed 12/14/2022
211/15/20228688176126DayThu 12/8/2022Fri 12/9/2022Sat 12/10/2022Sun 12/11/2022Mon 12/12/2022Tue 12/13/2022Wed 12/14/2022
311/16/2022707214494Value81162011409050
411/17/2022111326-24Thing83182213429252
511/18/20222325500Else16636442684184104
611/19/20227981162112But116-14-6-243413454
711/20/20228991182132
811/21/2022626412878
911/22/2022666813686
1011/23/20228890180130
1111/24/2022606212474
1211/25/202299101202152
1311/26/20227779158108
1411/27/20227577154104
1511/28/2022616312676
1611/29/20229193186136
1711/30/20229395190140
1812/1/2022575911868
1912/2/2022141632-18
2012/3/20227678156106
2112/4/20227981162112
2212/5/2022727414898
2312/6/202240428434
2412/7/20229092184134
2512/8/20228183166116
2612/9/2022161836-14
2712/10/2022202244-6
2812/11/2022111326-24
2912/12/202240428434
3012/13/20229092184134
3112/14/2022505210454
Sheet28
Cell Formulas
RangeFormula
O1O1=MAX(Table3[Date])
C2:C31C2=[@Value]+2
D2:D31D2=[@Thing]*2
E2:E31E2=[@Else]-50
I2:N2I2=J2-1
O2O2=TODAY()
I3:O6I3=TRANSPOSE(XLOOKUP(I2,Table3[[Date]:[Date]],Table3[[Value]:[But]],"",0))
Dynamic array formulas.

I'm having a difficult setting up my array... I guess the define names are throwing me off some... I can the column data to return to one cell on the table but not sure how to fill the entire column in the table.
 
Upvote 0
See where I have this:
Table3[[Value]:[But]]
This is actually pulling an array, not just one cell into the table in columns I to O. It's outputting everything in the matching row from [Value] to [But]. Then I transpose it to make it go vertical.
 
Upvote 0
See where I have this:
Table3[[Value]:[But]]
This is actually pulling an array, not just one cell into the table in columns I to O. It's outputting everything in the matching row from [Value] to [But]. Then I transpose it to make it go vertical.
Image 12-15-22 at 4.50 PM.jpg
 
Upvote 0
MrExcelPlayground14.xlsx
DEFGHIJKLMNOPQRSTUV
1
2Aspirate InvPounds Incinterated
3DateAcidBaseOxidizerReactT1 dayt1 nightt2dayt2night
4Tuesday, December 6, 202210469655210207848
5AspriateSat 12/10/2022Sun 12/11/2022Mon 12/12/2022Tue 12/13/2022Wed 12/14/2022Thu 12/15/2022Fri 12/16/2022Wednesday, December 7, 202211972169710246885
6Acid16804533447288Thursday, December 8, 202275678429500259849
7Base92307152935158Friday, December 9, 202272784542350725353
8Oxidizer94628664332556Saturday, December 10, 202216929439800927197
9React39448835824018Sunday, December 11, 202280306244480261340
10Aspirate Tot241216290184252188220Monday, December 12, 202245718688410417254
11Tuesday, December 13, 202233526435740923390
12TotalSat 12/10/2022Sun 12/11/2022Mon 12/12/2022Tue 12/13/2022Wed 12/14/2022Thu 12/15/2022Fri 12/16/2022Wednesday, December 14, 202244933382960939285
13T1 day800480410740960800970Thursday, December 15, 202272512540800539066
14t1 night92264192935381Friday, December 16, 202288585618970811697
15t2day71137233929016
16t2night97405490856697
17Tot1060559577955123010091164
Sheet31
Cell Formulas
RangeFormula
E5:J5,E12:J12E5=F5-1
K5,K12K5=MAX(Table1[Date])
E6:K9E6=TRANSPOSE(XLOOKUP(E5,Table1[[Date]:[Date]],Table1[[Acid]:[React]],"",0))
E10:K10,E17:K17E10=SUM(E6#)
E13:K16E13=TRANSPOSE(XLOOKUP(E12,Table1[[Date]:[Date]],Table1[[T1 day]:[t2night]],"",0))
N5:N14N5=N4+1
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,214,649
Messages
6,120,728
Members
448,987
Latest member
marion_davis

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