简体   繁体   English

如何像 B(2+4) 一样在 libreoffice calc 中表示单元格?

[英]How to represent cell in libreoffice calc like B(2+4)?

I need to do something in LibreOffice calc, but it depends on the number of the cell, so I would like to do something like this to represent the cell =AVERAGE(B(0x4+1):(1x4)) , but it doesn't work.我需要在 LibreOffice calc 中做一些事情,但这取决于单元格的数量,所以我想做这样的事情来表示单元格=AVERAGE(B(0x4+1):(1x4)) ,但它没有不行。 Can you help me?你能帮助我吗?

You can use the function INDIRECT to get a cell reference or range reference from text.您可以使用 function INDIRECT从文本中获取单元格引用或范围引用。

For example put this into A1:例如把它放到 A1 中:

=AVERAGE(INDIRECT("B"&(4*(ROW(A1)-1)+1)&":"&"B"&(4*ROW(A1))))

Here I use the row number as the value for your 0 and 1 , respectively.在这里,我分别使用行号作为01的值。

  • ROW(A1) returns 1 ROW(A1)返回 1
  • "B"&(4*(ROW(A1)-1)+1) returns "B1" "B"&(4*(ROW(A1)-1)+1)返回"B1"
  • "B"&(4*ROW(A1)) returns "B4" "B"&(4*ROW(A1))返回"B4"
  • Both concatenated together with ":" in the middle returns "B1:B4"两者与中间的":"连接在一起返回"B1:B4"
  • If you have A2 instead of A1 , the text will result in "B5:B8"如果您有A2而不是A1 ,则文本将导致"B5:B8"

If you copy this formula into A2 and following as many times as you see fit, you will get your averages.如果您将此公式复制到 A2 中并按照您认为合适的次数进行操作,您将获得平均值。

Disclaimer: I tried this with a non-English version of LibreOffice 7.1 and translated the function names.免责声明:我使用非英语版本的 LibreOffice 7.1 进行了尝试,并翻译了 function 名称。 They might be wrong.他们可能是错的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM