Populate cells if value "contains" a values in a look-up table

sshaffer99

Board Regular
Joined
Sep 29, 2010
Messages
111
Hi,

This may be too complicated for this forum, but I thought I'd ask.
I was wondering if someone can help me to create a button which will be available on every row and populate an income or expense category based on a look-up table.

Sample of My Spreadsheet:

Row B
ABCDE
TransactionAmountExpense CategoryIncome Category
ButtonPatter Exxon Main-25.00Fuel
ButtonExpo Salary250.00Services
ButtonBroad St Outback-32.00Meals
ButtonEast Fed Ex Prime6.50Postage

<tbody>
</tbody>

I will have a look-up table (sample below) with Keywords in the first column and a Category in the 2nd column.

In the table displayed above, Column B has transactions from a downloaded bank statement. When a button in row A is pressed, I'd like to see if B "contains" a value in the lookup table. If the keyword is found, populate D or E with the Category from the lookup table.
If the value in "C" is a positive number, populate column E with the category.
If the value in "C" is a negative number, populate column D with the category.
If D or E is already populated (not blank), do nothing (do not over-write value).

For Example,
if Column B contains "Exxon", populate Column "D" with "Fuel".
If Column B contains "Salary", populate Column "E" with "Services"
If Column B contains "Fed Ex", populate column "D" with "Postage"

Sample Look-up Table:

KeywordCategory
ExxonFuel
SalaryServices
Fed ExPostage

<tbody>
</tbody>

I know how to create a button in Column A, and I know how to create some very basic code for the button, but need help with the above.

Thanks in advance!
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Correction - Instead of having 2 category columns, one for income and one for expense, I will have 1 column for all categories. So I do not need the functionality to determine if column C is a positive or negative number. All categories will be populated in column D above.
 
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top