Regarding OpenOffice Calc: AFAIK you can't modify the behaviour of VLOOKUP
so it uses a CONTAINS check to determine the matching row. But if the relevant word is the the first one in the Description
column in every case, you could "prepare" the lookupvalue (the first argument of the VLOOKUP function) so it just uses the first word to look for. A solution may look like this:
=VLOOKUP(LEFT(B2, FIND(" ", B2)-1), $Sheet2.$A$2:$B$4, 2, 0)
(assuming `Sheet2.A2:B4 contains the lookup array). Split on multiple lines:
=VLOOKUP(
LEFT(
B2,
FIND(
" ",
B2
) -1),
$Sheet2.$A$2:$B$4,
2,
0
)
The first word of the Description
column is determined using LEFT
and FIND
.
So, with the following category table:
you would get the following result: