Home > Net >  How do I use autofill to match every other column?
How do I use autofill to match every other column?

Time:11-29

I want to use autofill to extend a row of formulas that applies to every other column, as seen below. (Row 7 is a representation of Row 6)

Google Sheet

If I just select the two formulas and drag to autofill, the autocompleted columns in the formula are C, E, E, G, G, .... I'd like them to be E, G, I, K, .... How can I achieve that?

CodePudding user response:

More easily accomplished using arrays than drag-filling formulas:

=lambda(range,bycol(filter(range,isodd(column(range))),lambda(col,sum(col))))(A3:E4)

Filter the array of values to obtain only the values from columns which are odd-numbered (corresponding to A/E/G/I/K...), then pass this array into BYCOL to get the sum for each column.

  • Related