Excel – How to search for case-sensitive and exact matches?

Recently, we often need to use uuid to match data. We often encounter two uuid. The difference is only in upper and lower case. It is no problem to use it in the database because mysql is case sensitive. However, when the data is processed through excel after exporting, the data is matched. There will be problems

As shown in the figure below, through vlookup matching, "AACb" will match the result of the first value "1" in order by default.

=VLOOKUP(F3,B:C,2,FALSE)

So simply using vlookup won't work.​ 

This can be solved by using the lookup+find function

The find function is case-sensitive. For details on related cases, please refer to Excel - Multi-condition Fuzzy Search, which outputs different results.

=LOOKUP(1,0/FIND(F4,B:B),C:C) 

 

Formula explanation:

FIND(F4,B:B): Fuzzy search for the cell containing the content of F4 in column B, and return the starting position of F4 in the searched cell. The result is a number; if not found, an error value is returned;

0/...: Generate a set of arrays: those with a value in the denominator, that is, those that meet the above search conditions, are 0, and the others are error values;

LOOKUP(1,...,c:c): Search for 1 in the above array. If not found, keep searching downwards until the last 0 value; find the cell at the corresponding position in column c.

This time I found the correct answer "5" 

Assuming that there are ids arranged in downward order, for example, there is AACb1, the result will also be incorrect.

 At this time, you can use the following formula to solve the problem by replacing find with exact.

=LOOKUP(1,0/EXACT(F5,B:B),C:C)

Guess you like

Origin blog.csdn.net/weixin_42056745/article/details/129936066