问题描述
假设我有一个Libreoffice.org Calc(也许这适用于MS Excel)对象定义为范围 $ Sheet1。$ A $ 1:$ A $ 4
。 我也已经声明了一个值为1的常量。对于这个模型,我们称之为 startingLine
。 p>
在定义名称对话框(快捷键:Ctrl + F3)中正确定义了两个对象。
我想要什么要做的是将定义范围的行转换为变量。在我看来,所有这一切将是这样定义的: $ Sheet1。$ A $ startingLine:$ A $ 4
,但这不行。 : - /
我正在寻找一个简单的电子表格解决方案,不幸的是宏不会为我这样做。然而,使用R1C1参考的解决方案将是足够好的。 :
任何帮助将大大赞赏
您将需要使用该公式的版本(excel) 要为您定义范围可能 Let's say I have a Libreoffice.org Calc (maybe this goes for MS Excel too) object defined as the range I also have declared a constant with value 1. For this mockup purpose, let's call it Both objects are properly defined in the Define Names dialog (shortcut: Ctrl+F3). What I would like to do is to turn the lines of the defined range into variables. In my mind, all it'd take would be to define it like this: I'm looking for a simple spreadsheet solution, unfortunately macros won't do it for me this time. A solution using R1C1 reference would be good enough, though. :) Any help will be greatly appreciated! You will need to use a version of this formula (excel) To define a range for you might be 这篇关于如何在Calc(或Excel)上定义动态范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
= CELL(contents,INDIRECT(CONCATENATE(A,startingLine))) code>
这给出了单元格A1的内容,其中 startingLine
是一个常量1.另外,如果我们定义 endLine
as A,我们可以用公式替换A:
= CELL(contents,INDIRECT(CONCATENATE(endsLine,startingLine)))
= INDIRECT(CONCATENATE($ sheet1。$ A $,起始线,:$ A $ 4))
例如总和(在excel中) = SUM((INDIRECT(CONCATENATE $ A $,startingLine:$ A $ 4))))
但我不熟悉libreoffice中的定义范围$Sheet1.$A$1:$A$4
.startingLine
.$Sheet1.$A$startingLine:$A$4
, but this doesn't work. :-/=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)))
=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