I have a spreadsheet of bank transactions. One column contains a description of the transaction however the text is not always exactly the same. e.g.
Date (a1), Description(b1), Amount(b3)
1/1/2012, Caltex sturt, $50.00
1/2/2012, Caltex mayford, $34.00
2/3/2012, Hobble Rd Caltex Mayford, $102.00
etc…
I would like to apply a classification to each entry, e.g. fuel, based on a regex for the classification. e.g. ^Caltex .*. I was hoping that vlookup would do this by allowing me to create a table with the classification patterns, e.g.
Regex(f1), Classification(g1)
.*Caltex.*, Fuel
^Coles.*, Food
etc…
And then apply =VLOOKUP(b2,f2:g5,2,0) to each row with the result as:
Date (a1), Description(b1), Amount(b1), Classification (c1)
1/1/2012, Caltex sturt, $50.00, Fuel
1/2/2012, Caltex mayford, $34.00, Fuel
2/3/2012, Hobble Rd Caltex Mayford, $102.00, Fuel
My take away from the documentation and trials is that this will not work. Could someone confirm this and possibly suggest an alternative?
22/10/2012 - In response to JohnSUN’s answer.
I see my question examples do suggest that I am after the first word however other examples could have the pattern of interest anywhere in the text, hence the need for the power of regex matching. For example, the description could have:
Hobble St Caltex Mayford
Caltex-Stafford Maryland
Rockford Caltex