How to calculate based on consecutive blanks?

MrMeerkat

New Member
Joined
Sep 8, 2023
Messages
3
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
Platform
  1. Windows
Hello everyone, this request sounds easy but i can’t seem to wrap my head around doing it. Thanks for you help in advance.

IMG_4432.jpeg

Help needed:

Left Table - Input
Right Table - Desired Output

In the desired output:

Streak - based on the consecutive blanks starting from first blank in the respective product column to last blank based on latest date input in the Date column
Last Price - Last filled value
2nd Last price - Second last filled value
3rd Last Price - Third last filled value
 
For 365 version.
In J2
Excel Formula:
=LET(Lr,LOOKUP(1,1/($A:$A<>""),ROW($A:$A)),a,($B$2:INDEX($E:$E,Lr)),rst,Lr-BYCOL(a,LAMBDA(clm,AGGREGATE(14,6,ROW(clm)/(clm<>""),1))),TRANSPOSE(rst))
In K2 copied up to M2
Excel Formula:
=LET(Lr,LOOKUP(1,1/($A:$A<>""),ROW($A:$A)),a,($B$2:INDEX($E:$E,Lr)),rst,BYCOL(a,LAMBDA(clm,INDEX(clm,AGGREGATE(14,6,(ROW(clm)-1)/(clm<>""),COLUMN(A1))))),TRANSPOSE(IFERROR(rst,"")))
 
Upvote 0

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

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