Return latest result within week cycle

Marklarbear

Board Regular
Joined
Nov 6, 2003
Messages
112
Office Version
  1. 365
Platform
  1. Windows
Hi wizards - hopefully this makes sense....

Below is a sample set of a process that I need my team to follow. We run on a 5 week cycle and record the numbers of products sold within a particular week in the cycle (range A2:B16). What I want is a formula in the 2nd table (range A21:B25) that returns the most up to date product sold for that week within the cycle - so it automatically updates the product sold. formulas to go in cells B21 down... hope that makes sense....


1706681585225.png
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try this

Excel Formula:
=LET(a,LET(Mark,FILTER($B$2:$B$16,$A$2:$A$16=A21),FILTER(Mark,Mark<>"","")),INDEX(a,COUNTA(a)))


1706683856740.png
 
Upvote 0
Or this

24 01 31.xlsm
AB
1WeekVolume
2156
32254
431
5457
6565
7123
8219
93238
104
115
121
132
143
154
165
17
18
19
20
21123
22219
233238
24457
25565
Latest
Cell Formulas
RangeFormula
B21:B25B21=TAKE(FILTER(B$2:B$16,(A$2:A$16=A21)*(B$2:B$16<>"")),-1)


If you want it to apply when all weeks may not yet have a value, perhaps this slight modification.

24 01 31.xlsm
AB
1WeekVolume
2156
32254
431
54
65
71
82
93
104
115
121
132
143
154
165
17
18
19
20
21156
222254
2331
244N/A
255N/A
Latest (2)
Cell Formulas
RangeFormula
B21:B25B21=TAKE(FILTER(B$2:B$16,(A$2:A$16=A21)*(B$2:B$16<>""),"N/A"),-1)
 
Upvote 0
Or this

24 01 31.xlsm
AB
1WeekVolume
2156
32254
431
5457
6565
7123
8219
93238
104
115
121
132
143
154
165
17
18
19
20
21123
22219
233238
24457
25565
Latest
Cell Formulas
RangeFormula
B21:B25B21=TAKE(FILTER(B$2:B$16,(A$2:A$16=A21)*(B$2:B$16<>"")),-1)


If you want it to apply when all weeks may not yet have a value, perhaps this slight modification.

24 01 31.xlsm
AB
1WeekVolume
2156
32254
431
54
65
71
82
93
104
115
121
132
143
154
165
17
18
19
20
21156
222254
2331
244N/A
255N/A
Latest (2)
Cell Formulas
RangeFormula
B21:B25B21=TAKE(FILTER(B$2:B$16,(A$2:A$16=A21)*(B$2:B$16<>""),"N/A"),-1)
I used the slightly modified version - works brilliantly!!!!
 
Upvote 0
I used the slightly modified version - works brilliantly!!!!
mmm.. one of my guys 'broke' the logic.... as an example - in cell B8 the value of 0 was entered... can the formula be modified to ignore a '0' entry and return the previous value for that week ? in this case it would return 254 for week 2 instead of 0.

Hope that makes sense...
 
Upvote 0
Or this

24 01 31.xlsm
AB
1WeekVolume
2156
32254
431
5457
6565
7123
8219
93238
104
115
121
132
143
154
165
17
18
19
20
21123
22219
233238
24457
25565
Latest
Cell Formulas
RangeFormula
B21:B25B21=TAKE(FILTER(B$2:B$16,(A$2:A$16=A21)*(B$2:B$16<>"")),-1)


If you want it to apply when all weeks may not yet have a value, perhaps this slight modification.

24 01 31.xlsm
AB
1WeekVolume
2156
32254
431
54
65
71
82
93
104
115
121
132
143
154
165
17
18
19
20
21156
222254
2331
244N/A
255N/A
Latest (2)
Cell Formulas
RangeFormula
B21:B25B21=TAKE(FILTER(B$2:B$16,(A$2:A$16=A21)*(B$2:B$16<>""),"N/A"),-1)
mmm.. one of my guys 'broke' the logic.... as an example - in cell B8 the value of 0 was entered... can the formula be modified to ignore a '0' entry and return the previous value for that week ? in this case it would return 254 for week 2 instead of 0.

Hope that makes sense...
 
Upvote 0
Assuming that means any zero entry is not to be counted then try this.

Excel Formula:
=TAKE(FILTER(B$2:B$16,(A$2:A$16=A21)*(B$2:B$16<>0),"N/A"),-1)
 
Upvote 0
Solution
Cheers. Thanks for the confirmation. :)
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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