Using relative positions in Excel formulas

拜拜、爱过 提交于 2019-11-28 22:41:05

You can use either

  • =OFFSET(F12,-1,0)+OFFSET(F12,0,-2)-OFFSET(F12,0,-1), or
  • =INDIRECT("F11",true)+INDIRECT("D12",true)-INDIRECT("E12",true)
  • =INDIRECT("R11C6",false)+INDIRECT("R12C4",false)-INDIRECT("R12C5",false)
  • =INDIRECT("R[-1]",false)+INDIRECT("C[-2]",false)-INDIRECT("C[-1]",false)

Both functions also allow to specify ranges, just use whatever has your personal preference (see Excel Help)…

  • You can switch e.g. to the R1C1 reference style (excel options)
  • Use OFFSET function (e.g. =OFFSET(F12;-1;0) for above)

Reading between the lines... is your actual problem creating a running total from additions and deductions columns?

You can sum each column starting with an absolute reference and ending with a relative reference

Assuming row 11 is your first, put =SUM(D$11:D12)-SUM(E$11:E12) in F12.

As you copy this cell down the absolute reference remains the same where the relative reference automatically updates extending the range. You can even copy the formula up one line and it will work on the first line too.

Deleting and inserting lines doesn't break the formula, though any extra cells would be included in the SUM().

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!