HI Jan,
Needles and haystacks come to mind, with the added complication that there are several needles, and the search in each case needs to determine which one we've found.
To extract a specific vendor name from each of the Bla bla haystacks, we need to do an individual search for each possible vendor, and stop the search when we've found the one included in 'this stack' or Search for every vendor on the list, mark the fact that 'this one' has (or that 'these ones' have) been found, then pull the one (or 'a' one) that's been found.
I chose the second route, with the option to attach the (extracted) Vendor column to the Bank Statement table or to make it in a separate table (Extracted V)
Vendor index:
A2 and filled down and right to all body cells in the table:
IFERROR(FIND(A$1,Bank Statement::$B2),0)
Each copy of the formula tries to FIND the vendor name at the top of its column in the Description on the same row of the Bank Statement table. If the name is found, FIND returns a number telling its 'first letter' position in the Description string. If it is not found, FIND returns an error, and IFERROR returns the value 0 (zero).
The xxxx value in the 'extra columns ensures there will be an error in the search for these values. If left empty, FIND would return a 1.
Note that FIND is case sensitive— 'amazon' was found (row 2), but Amazon was not (row 7). If the bank statements are consistent in never changing the case of initial letters of the names of specific vendors, you'll need one column for each vendor, if not, you'll need two columns for each vendor where this may occur. A similar caution could be made regarding possible variations in Mcdonalds, Mcdonald's, Macdonalds, etc.
With each 'found' vendor name marked by a value greater than zero in the row matching the row of the Bank statement where it was found.
There are two examples shown. The formulas in each are the same.
Bank Statement::D2:
Extracted V::A2: IFERROR(INDEX(Vendor index::$1:$1,1,MATCH(1,Vendor index::2:2,−1)) ,"Other")
Fill down to last row of table.
Maintenance:
Vendor index needs to have the same number of Header rows as Bank Statement, and as many (or more) rows as (than) Bank Statement. The same is true for Extracted V if that table is used.
The Vendor column or Extracted V table will continue to work 'without error' if they contain more rows that the Vendor index table, as errors will be caught by IFERROR and replaced with "Other"
This can serve as a warning that more rows need to be added to the Vendor index table or that the vendor named in Bank statement's Description is not listed in the header row of Vendor index, and needs to be added.
Regards,
Barry