попробовать:
=ARRAYFORMULA(IFNA(VLOOKUP(
IF(F4:F12<>"", VLOOKUP(ROW(A4:A12),
IF(G4:G12<>"", {ROW(A4:A12), G4:G12&"♦"}), 2, 1), )&F4:F12, {
IF(B4:B12<>"", VLOOKUP(ROW(A4:A12),
IF(A4:A12<>"", {ROW(A4:A12), A4:A12&"♦"}), 2, 1), )&B4:B12, C4:C12}, 2, 0)))