Excel – How do I get the n-th text within a range of cells if some cells within the range are empty?

huangapple go评论67阅读模式
英文:

Excel - How do I get the n-th text within a range of cells if some cells within the range are empty?

问题

以下是翻译好的部分:

Milestone payments which only apply in some cases

情况:列“现金流入”预先填充了所有可能的里程碑。将来,用户只应在相应的里程碑记录了流入时才输入值。这意味着许多里程碑的支付将保持为空。

目标:在一个单独的表中,我想创建一个适用于特定项目的里程碑概览。因此,我希望有一个可以识别已记录了付款的第一个里程碑的公式(即流入总和不等于零)。由于我想复制这个公式,因此它应该作为下一步识别表是否已包含第一个(第二个、第三个等)里程碑,然后输出第二个(第三个、第四个等)里程碑。

我应该使用哪个公式?

我已经尝试过
INDEX('Cash-inflows'!B29:B58;MATCH(TRUE;ISTEXT('Cash-inflows'!B29:B58);0))
这会输出第一个里程碑。对于后续单元格,我尝试了

=INDEX('Cash-inflows'!$B$29:$B$58;SMALL(IF('Cash-inflows'!$B$29:$B$58=C8;ROW('Cash-inflows'!$B$29:$FE$58)-MIN(ROW('Cash-inflows'!$B$29:$FE$58))+3);1))

其中列B始终指的是一个辅助列,仅在支付总额不等于零时才输出里程碑。第二个公式的问题是,我仍然需要手动调整“+3”。因此,我将一无所获。

英文:

I am currently working on an excel file where I would love to get your help with a formula.

Milestone payments which only apply in some cases

Situation: The column "cash-inflows" is pre-filled with all possible milestones. In the future, users should only type in the values if an inflow was recorded for the corresponding milestone. This means that payments for many milestones will remain empty.

Goal: In a separate table, I want to create an overview of milestones which apply to the specific project. I would therefore love to have a formula which identifies the first milestone where a payment has been recorded (i.e. the sum of inflows unequals zero). As I would like to copy the formula, it should, as a next step, identify if the table already contains the first (second, third etc.) milestone and hence spit out the second (third, fourth etc.) milestone.

Which formula should I use?

I have already tried

INDEX('Cash-inflows'!B29:B58;MATCH(TRUE;ISTEXT('Cash-inflows'!B29:B58);0))

This spits out the first milestone. For subsequent cells I have tried

=INDEX('Cash-inflows'!$B$29:$B$58;SMALL(IF('Cash-inflows'!$B$29:$B$58=C8;ROW('Cash-inflows'!$B$29:$FE$58)-MIN(ROW('Cash-inflows'!$B$29:$FE$58))+3);1))

whereby column B always refers to a helping column which only spits out the milestone if the sum of payments unequals zero. The problem with the second formula is that I would still have to adjust the "+3" manually. I would therefore gain nothing.

答案1

得分: 2

使用Microsoft 365,您可以使用以下公式:=TAKE(TOCOL('Cash-inflows'!$B$29:$B$58,1),-1),其中TOCOL与条件1一起过滤掉空白单元格,而TAKE与参数-1一起从TOCOL数组底部取出第一个(等于最后一个非空值)。

在旧版本的Excel中,您可以使用以下公式:INDEX(ROW(2:2),MAX(IF('Cash-inflows'!$B$29:$B$58<>"",COLUMN('Cash-inflows'!$B$29:$B$58)))),然后按ctrl+shift+enter输入。

英文:

With Microsoft 365 you could use: =TAKE(TOCOL('Cash-inflows'!$B$29:$B$58,1),-1)
Where TOCOL with condition 1 filters out the blanks and TAKE with argument -1 takes the first from the bottom of the TOCOL array (equals the last non-empty value).

In older Excel you could use:
INDEX(ROW(2:2),MAX(IF('Cash-inflows'!$B$29:$B$58<>"",COLUMN('Cash-inflows'!$B$29:$B$58)))) entered with ctrl+shift+enter

huangapple
  • 本文由 发表于 2023年6月16日 01:55:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/76484328.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定