How to define dynamic ranges on Calc (or Excel)?

后端 未结 2 1677
隐瞒了意图╮
隐瞒了意图╮ 2021-02-06 08:36

Let\'s say I have a Libreoffice.org Calc (maybe this goes for MS Excel too) object defined as the range $Sheet1.$A$1:$A$4.

I also have declared a constant w

2条回答
  •  礼貌的吻别
    2021-02-06 09:14

    You will need to use a version of this formula (excel) =CELL("contents",INDIRECT(CONCATENATE("A",startingLine)))
    This gives you the contents of cell A1 where startingLine is a constant 1. Additionally, if we define endingLine as A, we can replace A in the formula:
    =CELL("contents",INDIRECT(CONCATENATE(endingLine,startingLine)))

    To define a range for you might be =INDIRECT(CONCATENATE("$sheet1.$A$",startingLine,":$A$4"))
    for instance to sum (in excel) =SUM((INDIRECT(CONCATENATE("$A$",startingLine,":$A$4")))) but I am unfamiliar with the defining ranges in libreoffice

提交回复
热议问题