Drag down formula and change COLUMN references instead of ROWS

后端 未结 2 1431
无人及你
无人及你 2021-01-02 05:26

I have this formula in Excel, in row E5:

=SUM(Banco!H$5;Banco!H$6;Banco!H$8;Banco!H$9;Banco!H$10;Banco!H$11)

I need it to change the COLUMN

相关标签:
2条回答
  • 2021-01-02 05:39

    ... Use the offset function.

    For example - Suppose you had a formula in row 1 and you wanted to reference Banco!H5, you could do something like:

    =OFFSET(Banco!$G$5,0,ROW())
    

    Now, as you drag it down, it will offset by the number of rows down you go.

    So your new formula would look as follows:

    =SUM(OFFSET(Banco!$G$5,0,ROW()),OFFSET(Banco!$G$6,0,ROW()),OFFSET(Banco!$G$8,0,ROW()),OFFSET(Banco!$G$9,0,ROW()),OFFSET(Banco!$G$10,0,ROW()),OFFSET(Banco!$G$11,0,ROW()))
    

    Again, this assumes you are pasting this formula in row 1 (I know it's ugly, but you specified specific cells, so you have to specify each one separately)

    Hope this makes sense

    0 讨论(0)
  • 2021-01-02 05:48

    Use a combination of the OFFSET and the COUNTA function. The OFFSET function will give the offset of COUNTA columns each time you go down a row. Make the counta function count the number of rows above the row that you're dragging the entire function into (aka each time you drag the function to an extra row, it will add 1)

    0 讨论(0)
提交回复
热议问题