How to use the lookup function to query accurately?
Lookup function precise search method
As shown in the table below, we want to query student scores based on name,
In this example we want to Check "Cai Jian"'s "Chinese" score.
Recommended learning: Excel basic tutorial
Enter "=lookup(" in the cell as shown, a prompt will appear:
LOOKUP(lookup_value,lookup_vector,result_vector) [Vector form]
The first parameter "lookup_value" asks us what value we want to query and tells the computer us To query the value "1",
The second parameter "lookup_vector" asks us which area we want to query,
Enter: 0/( A2:A8=F2),
(A2:A8=F2) is a logical array formula,
press F9 to view the operation result: {FALSE;FALSE;FALSE;TRUE;FALSE; TRUE;FALSE},
What this formula calculates is not a value, but a set of logical values.
(A2:A8=F2) is a set of logical values, 0/( A2:A8=F2) is 0 divided by a set of logical values.
In the four arithmetic operations, 1 is usually used to replace the logical true value true, and 0 is used to replace the logical false value false.
0 /{FALSE;FALSE;FALSE;TRUE;FALSE;TRUE;FALSE}, which is equivalent to,
0/{0;0;0;1;0;1;0}, 0/0 The result is the error value #DIV/0!, the result of 0/1 is 0,
gets the array: {#DIV/0!;#DIV/0!;#DIV/0!;0;#DIV /0!;0;#DIV/0!}
at{#DIV/0!;#DIV/0!;#DIV/0!;0;# Query 1 in DIV/0!;0;#DIV/0!},
cannot match the same value, then match the maximum value less than 1,
then matches 0, function Returns 58 in another set of numbers B2:B8 corresponding to 0.
This enables precise querying using the lookup function.
The above is the detailed content of How to search accurately using lookup function. For more information, please follow other related articles on the PHP Chinese website!