In Excel 365, you can work with spilled ranges.
The base formula you have to type uses the MAX(ROW(...))
/OFFSET
trick to return a dynamic (spilled) range and would be something like (to type in Sheet2!C1
):
=LET(MaxRow, MAX(IF(NOT(ISBLANK(Sheet1!C:C)),ROW(Sheet1!C:C))), OFFSET(Sheet1!C:C,0,0,MaxRow))
Note that you can work with more than just column C. Based on the above formula, we change the last part to be (using a 2-column contiguous range and the HSTACK
function to add a third separate column):
LET(MaxRow, MAX(IF(NOT(ISBLANK(Sheet1!C:C)),ROW(Sheet1!C:C))), HSTACK(OFFSET(Sheet1!C:D,0,0,MaxRow), OFFSET(Sheet1!F:F,0,0,MaxRow)))
For formulas that use the resulting range, you will have to learn about the spilled range operator.
In Sheet2:F1
, type:
="I test the spilled range operator with " & C1#
If you used the version of the formula returning 3 columns, you will see C1#
"spills" on 3 columns too. This is easily solved by using the INDEX
function like so (the 2 consecutive commas are not a mistake):
="I test the spilled range operator with " & INDEX(C1#,,1)