[英]Lookup for 2nd, 3rd, ..nth match and return sorting results from smallest to largest values?
I have tried searching on google but I didn't find the solution yet.我试过在谷歌上搜索,但我还没有找到解决方案。 I would like to lookup the value that match with conditions and return result with sorting from small to large.
我想查找与条件匹配的值并返回从小到大排序的结果。 What formula should i use to do this?
我应该使用什么公式来做到这一点? Thank you very much.
非常感谢。
To retrieve multiple matching values from a set of data with a formula, you can use the IF and SMALL functions to figure out the row number of each match and feed that value back to INDEX.要使用公式从一组数据中检索多个匹配值,您可以使用 IF 和 SMALL 函数来计算每个匹配的行号并将该值反馈给 INDEX。
{=INDEX(array,SMALL(IF(vals=val,ROW(vals)-ROW(INDEX(vals,1,1))+1),nth))}
Where:在哪里:
As always when working with array formulas, use ctrl+shift+enter instead of normal enter与使用数组公式时一样,使用 ctrl+shift+enter 而不是正常的 Enter
If you have duplicate values in Time
column, the following array formula can help :如果
Time
列中有重复值,以下数组公式可以提供帮助:
{=IFERROR(SMALL(IF(($D2=$A$2:$A$12)*($B$2:$B$12>=TIME(7,0,0))*($B$2:$B$12<=TIME(10,0,0)),IF(COUNTIF($D2:D2,$B$2:$B$12)=0,$B$2:$B$12)),1),"")}
Array formula after editing is confirmed by pressing ctrl
+ shift
+ enter
按
ctrl
+ shift
+ enter
确认编辑后的数组公式
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.