简体   繁体   中英

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. 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. 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

=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])

  • 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.

  • If lookup_value is smaller than the smallest value in lookup_vector, LOOKUP returns the #N/A error value.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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