多列Arrayformula运行总计

我有以下任务要解决,但是我无法解决这个问题。

不同年份有几个数字。我想获得J列中所有列(=范围C:I)的运行总和。我可以在J的每个单元格中使用一个公式来实现这一点-但是我需要在J2中使用单个arrayformula来实现。 / p>

多列Arrayformula运行总计

经过大量研究,我认为是两个步骤:

  1. 将空单元格替换为0,因为arrayformulas显然对空单元格存在一些问题
  2. 对每一行求和

对于第1步,公式为:=ARRAYFORMULA(IF(ISBLANK(C2:I15),C2:I15)),这给了我一个临时数组,如:

多列Arrayformula运行总计

因为这是一个15x7的数组,所以我需要像7x1的数组相乘才能得到15x1的数组。

该公式为:=ARRAYFORMULA(TRANSPOSE(COLUMN(C1:I1)^0))

多列Arrayformula运行总计

所以最终我的公式如下:=ARRAYFORMULA(MMULT(IF(ISBLANK(C2:I15),C2:I15),TRANSPOSE(COLUMN(C1:I1)^0)))

这将导致一个15x1的数组,该数组为我提供每行的总和,而不是所有行的总运行总和。

多列Arrayformula运行总计

这就是我的地方-任何帮助和想法都将不胜感激。

编辑:添加了一个共享版本供您摆弄:https://docs.google.com/spreadsheets/d/1cqNEsWHqBaHdDrMY8x4DUKpEkYprRZ8AibEe7d0knPY/edit?usp=sharing

zpr6j 回答:多列Arrayformula运行总计

我认为这也会起作用:

=ARRAYFORMULA(IF(B2:B="";;SUMIF(SEQUENCE(ROWS(C2:I);COLUMNS(C2:I));"<="&SEQUENCE(ROWS(C2:I);1;COLUMNS(C2:I);COLUMNS(C2:I));C2:I)))
,

尝试:

//default.json
"authentication": {
  "entity": "user","service": "users","secret": ** ** ** ** ** *,"authStrategies": [
    "jwt","local"
  ],...
},"authentication": {
  "entity": "user2","service": "users2",...


// authentication.ts
...
export default function(app: Application) {
  const authentication = new AuthenticationService(app,'authentication');
  authentication.register('jwt',new JWTStrategy());
  authentication.register('local',new LocalStrategy());
  app.use('/authentication/users',authentication2);

  const authentication2 = new AuthenticationService(app,'authentication2');
  authentication2.register('jwt',new JWTStrategy());
  authentication2.register('local',new LocalStrategy());
  app.use('/authentication/users2',authentication2);

  app.configure(expressOauth());
}
...

// user.hooks.ts / user2.hooks.ts
import * as feathersAuthentication from '@feathersjs/authentication';
import * as local from '@feathersjs/authentication-local';
// Don't remove this comment. It's needed to format import lines nicely.

const {
  authenticate
} = feathersAuthentication.hooks;
const {
  hashPassword,protect
} = local.hooks;

export default {
  before: {
    all: [],find: [authenticate('jwt')],get: [authenticate('jwt')],create: [hashPassword('password')],update: [hashPassword('password'),authenticate('jwt')],patch: [hashPassword('password'),remove: [authenticate('jwt')]
  },after: {
    all: [
      // Make sure the password field is never sent to the client
      // Always must be the last hook
      protect('password')
    ],find: [],get: [],create: [],update: [],patch: [],remove: []
  },error: {
    all: [],remove: []
  }
};

0

本文链接:https://www.f2er.com/2744137.html

大家都在问