简体   繁体   English

谷歌表对前行数据求和 + 常量变量

[英]google sheets sum on previous rows data + constant variable

I'm currently facing a problem which I cannot solve, would appreciate help.我目前面临一个我无法解决的问题,希望得到帮助。

a link to the spreadsheet电子表格的链接

click here 点击这里

now, here is the problem.现在,问题来了。 I want H to be calculated by the sum of previous months(H)+ portfolio size(K8) * G of the current row.我希望 H 由前几个月(H)+ 投资组合规模(K8)* 当前行的 G 之和计算。 in array formula so I won't need to add the function each time I create a new row.在数组公式中,因此每次创建新行时都不需要添加该函数。

but if it exceeds 10,000 that it will be G(current row)*10,000.但如果超过 10,000,它将是 G(当前行)*10,000。

for example:例如:

row 4, IF(portfolio size + SUM (H2:H3)>10000,G4*10000,G4* (portfolio size(K8) + SUM (H2:H3)))第 4 行, IF(portfolio size + SUM (H2:H3)>10000,G4*10000,G4* (portfolio size(K8) + SUM (H2:H3)))

row 5, IF(portfolio size + SUM (H2:H4)>10000,G4*10000,G4* (portfolio size(K8) + SUM (H2:H4))) and so on.第 5 行, IF(portfolio size + SUM (H2:H4)>10000,G4*10000,G4* (portfolio size(K8) + SUM (H2:H4)))等等。

would appreciate the help感谢您的帮助

try:尝试:

=ARRAYFORMULA(IF(A2:A="",,IF(K8+IF(A2:A="",,
 {0; MMULT(TRANSPOSE((ROW(B2:B)<=TRANSPOSE(ROW(B2:B)))*G2:G*K8), 
 SIGN(G2:G)^0)})>K8,G2:G*K8, (K8+IF(A2:A="",,
 {0; MMULT(TRANSPOSE((ROW(B2:B)<=TRANSPOSE(ROW(B2:B)))*G2:G*K8), 
 SIGN(G2:G)^0)}))*G2:G)))

在此处输入图片说明

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

相关问题 如何对同一行但前一列中为零的列中的所有单元格求和? (谷歌表格) - How to SUM all cells in a column that are equal zero in the same row but previous column? (Google Sheets) 带有SUM的Google表格上的RANK IF公式 - RANK IF formula on Google Sheets with SUM 如何基于两行数据在Google表格上创建if语句 - how to create an if statement on google sheets based on two rows of data R:修改一个变量,该变量以来自多个先前行的数据为条件 - R: modify a variable conditioned on data from multiple previous rows 在 Google 表格中区分 2 组行 - Diff 2 sets of rows in Google Sheets Google表格的SUM基于多个表格中的条件标准 - Google Sheets' SUM based on criteria of criteria in multiple sheets 如何将数据矩阵(x 和空值)转换为 Google 表格中的关系行? - How to convert a data matrix (x's and nulls) into relational rows in Google Sheets? Google 表格:使用间接 function 排除查询中拉取唯一数据的隐藏行 - Google Sheets: EXCLUDE hidden rows in query pulling unique data using indirect function 谷歌表格 ARRAYFORMULA 跳过空白行 - Google Sheets ARRAYFORMULA to skip blank rows 在某些列值为零的Google表格中获取以前的rowindex - Get previous rowindex in Google Sheets where certain columnvalue is zero
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM