使用Excel函数:如何根据最大版本号选择行

问题描述 投票:0回答:1

如果构建的进度完成率为 100%,我创建了一个公式来过滤项目列表。然而,有些项目有修订,然后最终将重新开始其进度完成。

我遇到的问题是我的过滤功能将拉入项目的所有版本。我如何让过滤器函数只返回最新版本的行。现在,过滤器正在将其基础化 <100% but there are still duplicates of the item #.

我使用的公式:=(FILTER(Table2,Table2[Progress Category]="<100%"))

原始数据示例: |商品编号 |版本 # |进度 % | | -------- | -------------- |---------- | | 1 | 1 |100% | | 2 | 1 |100% | | 2 | 2 |80% | | 3 | 1 |100% | | 3 | 2 |100% | | 3 | 3 |90% | | 4 | 1 |100% | | 5 | 1 |100% | | 5 | 2 |80% | | 6 | 3 |100% |

预期输出(1项最新版本和最新进度%): |商品编号 |版本 # |进度 % | | -------- | -------------- |---------- | | 1 | 1 |100% | | 2 | 2 |80% | | 3 | 3 |90% | | 4 | 1 |100% | | 5 | 2 |80% | | 6 | 3 |100% |

谢谢!

excel function excel-formula formula ranking
1个回答
0
投票

为了实现预期的输出,您想要过滤行以仅显示进度小于 100% 的每个项目的最新版本,您可以通过将 SORT 和 UNIQUE 函数与 FILTER 结合起来来修改公式。

调整公式的方法如下: 分步说明: 过滤进度小于 100% 的行:您已经使用 FILTER(Table2,Table2[Progress Category]<"100%"). Sort the filtered data by Item # and Version #: Sorting will help you ensure that the latest version appears last for each item. Get the latest version for each item: After sorting, you can use the UNIQUE function to extract only the most recent version for each item.

最终公式 =UNIQUE(排序(过滤器(表2,表2[进度%]<1), Table2[Item #], TRUE, Table2[Version #], TRUE), TRUE)

如果这不起作用,请联系我们:https://codeliya.github.io

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.