Some changes that have been made.
There are now four helper columns XFA:XFD
The formula for XFA is*:
Formula:
=IFERROR(IF(LEFT(XFD3,2)="JB",INDEX(D4:D$42,SMALL(IF(D4:D$19<>"",ROW(4:$19)-ROW(3:3)),COUNTIFS(XFB$3:XFB3,1))),XFD3),"")
The formula for XFB is:
Formula:
=IF(LEFT(XFD3,2)="JB",IF(SUM(M2,1)>MIN(XFC3:XFC11),1,SUM(M2,1)),IF(COUNTIFS(XFD$3:XFD3,XFD3)<=XFC3,COUNTIFS(XFD$3:XFD3,XFD3),""))
The formula for XFC is: =IFERROR(ROWS(INDIRECT(XFD3)),"")
The formula for XFD is still: =IF(D3<>"",D3,XFD2)
The formula for the range E3:J42 is:
Formula:
=IFERROR(IF(INDEX(INDIRECT($XFA3),$XFB3,COLUMN(A:A))=0,"",INDEX(INDIRECT($XFA3),$XFB3,COLUMN(A:A))),"")
*Denotes an array entered formula which is confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER before being copied. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
Let us know if you have any questions.
Bookmarks