简体   繁体   English

Google表格参考表格索引功能

[英]Google Sheets Reference form Index function

I have reference based index function in an xlsx spreadsheet 我在xlsx电子表格中具有基于引用的索引功能

=SUM(B10:INDEX(B10:AJ10,$D$5-1))

However importing this spreadsheet in google sheets broke the function as Index doesn't return reference any more instead return the value at the index. 但是,将此电子表格导入Google表格会破坏该功能,因为Index不再返回引用,而是返回索引处的值。

I wonder how can I solve this problem in google sheets. 我想知道如何在Google表格中解决此问题。

That formula doesn't look correct. 该公式看起来不正确。 You are using the INDEX function for the extents of the range in a single row but you are returning the row number, not the column number to extend to. 您正在将INDEX函数用于单行范围的范围,但是您将返回行号,而不是要扩展到的列号。

=SUM(B10:INDEX(B10:AJ10, , $D$5-1))

That small modification should correct the range. 进行较小的修改即可校正范围。 With 7 in D5 this would be SUM(B10:G10) in Excel. 在D5中使用7,这将是Excel中的SUM(B10:G10)

However, Google-Docs cannot use INDEX like that. 但是,Google文档不能像这样使用INDEX。 Use the OFFSET function instead. 请改用OFFSET功能

=SUM(offset(B10:AJ10, 0, 0, 1, $D$5-1))

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

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