组内子组的唯一排名值
我正在尝试获得唯一的等级值(例如{1,2,3,4}
从我的数据中的一个子组中。 ,我正在尝试将计端添加到终点,以调整副本的
subgroup
col B col M rank
LMN 01 1
XYZ 02
XYZ 02
ABC 03
ABC 01
XYZ 01
LMN 02 3
ABC 01
LMN 03 4
LMN 03 4 'should be 5
ABC 02
XYZ 02
LMN 01 1 'should be 2
。
=SUMPRODUCT(($B$2:$B$38705=B2)*(M2>$M$2:$M$38705))+countifs(B2:B38705=B2,M2:M38705=M2)
排名
I am trying to get a unique rank value (e.g. {1, 2, 3, 4}
from a subgroup in my data. SUMPRODUCT will produce ties{1, 1, 3, 4}
, I am trying to add the COUNTIFS to the end to adjust the duplicate rank away.
subgroup
col B col M rank
LMN 01 1
XYZ 02
XYZ 02
ABC 03
ABC 01
XYZ 01
LMN 02 3
ABC 01
LMN 03 4
LMN 03 4 'should be 5
ABC 02
XYZ 02
LMN 01 1 'should be 2
So far, I've come up with this.
=SUMPRODUCT(($B$2:$B$38705=B2)*(M2>$M$2:$M$38705))+countifs(B2:B38705=B2,M2:M38705=M2)
What have I done wrong here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好消息是,您可以丢弃 sumproduct函数并用一对 countifs函数。 Countifs可以使用完整的列引用而毫无损害,并且即使Sumpropropoduct Cell范围仅限于数据的范围,也比Sumpropraptuct更有效。
在N2作为标准功能中,
根据需要填写。
” net/anlsh.png“ alt =” rank_unique_subgroups_sample_data“>
//i.sstatic.net/gsetu.png“ alt =” rank_unique_subgroups_groups_a滤波结果“> >
。
The good news is that you can throw away the SUMPRODUCT function and replace it with a pair of COUNTIFS functions. The COUNTIFS can use full column references without detriment and is vastly more efficient than the SUMPRODUCT even with the SUMPRODUCT cell ranges limited to the extents of the data.
In N2 as a standard function,
Fill down as necessary.
Filtered Results
基于 OP 的解决方案
研究了您要求发布任何替代方案的帖子,我对基于您通过
SUMPRODUCT
函数的原始方法的解决方案感兴趣。IMO这可以显示正确的方式为了艺术:
应用方法
获取
a)所有当前ID与组值低于或等于当前值
MINUS
b ) 具有相同组值的当前 id 的数量从当前行开始计数
PLUS
公式示例,例如在单元格 N5 中:
PS
当然,我也同意您更喜欢上面发布的解决方案:+)
Solution basing on OP
Studying your post demanding to post any alternatives, I got interested in a solution based on your original approach via the
SUMPRODUCT
function.IMO this could show the right way for the sake of the art:
Applied method
Get
a) all current ids with a group value lower or equal to the current value
MINUS
b) the number of current ids with the identical group value starting count from the current row
PLUS
Formula example, e.g. in cell N5:
P.S.
Of course, I agree with you preferring the above posted solution, too :+)