Here are two solutions:
OFFSET
Due to the volatile character of OFFSET
, I revised my previous answer (option 2) which does no longer use OFFSET
. More complex, but does consume lesser resources.
D4
features =CHOOSE(MOD(COLUMN(),2)+1,INDEX($A$3:$A$5,ROUNDUP((COLUMN()-COLUMN($C$4))/2,0),MOD(COLUMN(),2)),INDEX($B$3:$B$5,ROUNDUP((COLUMN()-COLUMN($C$4))/2,0),MOD(COLUMN();2)))
CHOOSE
determines, whether the result should derive from column A
or B
(see the different anchors in both INDEX
formulas. Apart from that, both formulas are equal.INDEX
formula is explained in Option 2.OFFSET
Here is a solution with the OFFSET
function, driven by COLUMN
.
D4
features the following formula
=OFFSET($A$2,ROUNDUP((COLUMN()-COLUMN($C$4))/2,0),MOD(COLUMN(),2))
Breakdown
OFFSET
(anchor, rows, columns)