Question: I'm trying to do a lookup in Excel where the reference value is stored somewhere in a string. For example, in row 2 below, cell D2 should return "Fixed Housing Expenses" as cell B2 contains the word "Compuserve". In row 3, cell D3 should return "Salary" as cell B3 contains the word "MyCompany".
|
Answer: Let's take a look at an example. Download Excel spreadsheet (as demonstrated below)
|
In our spreadsheet, we've created a custom function called Partial_Lookup which accepts 3 parameters.
You can press Alt-F11 to view the VBA code. Macro Code:The macro code looks like this:
|
Visit our busy book shop, were you can find latest books for beginners as well as advanced excel users.
Spreadsheet 123 Spreadsheet Software Development
See Spreadsheets for:
a.Hotel Management b.Personal Budget
c.Corporate Finance d.Rating Calculation e.Real Estate and Mortgage
f.Web Calc