简体   繁体   English

Excel查找/搜索和匹配

[英]Excel Lookup/Search and Match

I am trying to get to the bottom of an issue I have been struggling with for days, in my example I have to match what is in column G to what is in column A whether it be a complete match or a partial match, then check that the Qty matches and pull across the Sal value. 我试图弄清我一直困扰着的问题的底部,在我的示例中,我必须将G列中的内容与A列中的内容进行匹配,无论是完全匹配还是部分匹配,然后检查数量匹配并跨越Sal值。 My example works with an exception. 我的示例例外。 If an ID appears multiple times in my Lookup table but has different Qty, it only validates the last one in my reference table. 如果一个ID在我的Lookup表中多次出现,但具有不同的Qty,则仅验证我的参考表中的最后一个ID。 I have put this in to my attached example. 我已将其放入我的附加示例中。

=IFERROR(IF(H2=LOOKUP(2^15,SEARCH($A$1:$A$12,G2),$D$1:$D$12),LOOKUP(2^15,SEARCH($A$1:$A$12,G2),$C$1:$C$12),"Qty Issue"),"UnKnown ID")

I have this in an example file but unfortunately no way to upload it. 我在一个示例文件中有此文件,但不幸的是没有办法上传它。

示例数据

Download File 下载文件

Closest formula put to J2, as your expected K7 (60) and K11 (0) values has no logic J2最接近的公式,因为您期望的K7(60)和K11(0)值没有逻辑

=SUMIFS($C$1:$C$12,$A$1:$A$12,LOOKUP(2^15,SEARCH($A$1:$A$12,G2),$A$1:$A$12),$D$1:$D$12,H2)

Syntax 句法

LOOKUP(lookup_value, lookup_vector, [result_vector]) LOOKUP(lookup_value,lookup_vector,[result_vector])

  • If the LOOKUP function can't find the lookup_value, the function matches the largest value in lookup_vector that is less than or equal to lookup_value. 如果LOOKUP函数找不到lookup_value,则该函数将匹配lookup_vector中小于或等于lookup_value的最大值。

  • If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP returns the #N/A error value. 如果lookup_value小于lookup_vector中的最小值,则LOOKUP返回错误值#N / A。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM