简体   繁体   English

Google表格中的数组减法

[英]Array subtraction in Google Sheets

I have two arrays and I want a resulting array that's the vector difference.我有两个数组,我想要一个作为向量差异的结果数组。

A1:A10 and B1:B10 have numeric values, and I want {A1:A10}-{B1:B10}, but that just gives me A1-B1, not the full array. A1:A10 和 B1:B10 有数值,我想要 {A1:A10}-{B1:B10},但这只会给我 A1-B1,而不是完整数组。 Is there a subtraction operator for arrays?数组有减法运算符吗?

Example Sheet: https://docs.google.com/spreadsheets/d/1rjh_mkpZdz7LX4V0obxEmfRLdZ2CoTIjdpxVLHYBD5s/edit#gid=0示例表: https : //docs.google.com/spreadsheets/d/1rjh_mkpZdz7LX4V0obxEmfRLdZ2CoTIjdpxVLHYBD5s/edit#gid=0

I want the result in D1 without the extra column C我希望 D1 中的结果没有额外的 C 列

use ArrayFormula:使用数组公式:

=ARRAYFORMULA(A1:A10-B1:B10)

or shorter Index:或更短的索引:

=INDEX(A1:A10-B1:B10)

or longer Query:或更长的查询:

=QUERY(A1:B10, "select A-B label A-B''", 0)

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

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