Formula for: Placing a name in a column if it meets certain criteria

raindrop

Board Regular
Joined
Jul 31, 2011
Messages
57
Formula for: Placing a name in a column if it meets certain criteria

I have a column of food in column A and I need to put the category in column B by looking at Column 1.


Any ideas to a simple formula? I have tried various ones, only able to have up to two variables. My actual data set will have approximately 20 items in Column A and 7 categories.



example:



<table border="0" cellpadding="0" cellspacing="0" height="280" width="337"><colgroup><col style="width:48pt" span="2" width="64"> </colgroup><tbody><tr style="height:14.4pt" height="19"> <td style="height:14.4pt;width:48pt" height="19" width="64">Column A</td> <td style="width:48pt" width="64">Formula goes here: Column B</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Apple</td> <td>Fruit</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Orange</td> <td>Fruit</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Grape</td> <td>Fruit</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Potato
</td> <td>Veggie</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Celery
</td> <td>Veggie</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Carrot</td> <td>Veggie</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Pork</td> <td>Meat</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Chicken</td> <td>Meat</td> </tr> <tr style="height:14.4pt" height="19"> <td style="height:14.4pt" height="19">Steak</td> <td>Meat</td> </tr> </tbody></table>
 
Last edited:

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I planed to type the name in using "fruit" etc... but I can put it in column A on a separate worksheet. The data would go in column B on the first worksheet.
Thoughts to the best way to approach this?
 
Upvote 0
I planed to type the name in using "fruit" etc... but I can put it in column A on a separate worksheet. The data would go in column B on the first worksheet.
Thoughts to the best way to approach this?

A formula in column B can do categorizing if it can look up the item and find the category the item is associated with. This would mean something like:

=VLOOKUP(A2,Table,2,0)

where Table is a range associating a unique item with a category.

Table must already exist, created possibly manually or obtained from some source.
 
Upvote 0
thanks this worked. I was hoping for a different formula, because I notice that I use the same type of formula in other situations and it jams up excel some. Do you have any thoughts to this type of situation?

The VLOOKUP seems to be working fine in this scenario.
 
Upvote 0
thanks this worked. I was hoping for a different formula, because I notice that I use the same type of formula in other situations and it jams up excel some. Do you have any thoughts to this type of situation?

The VLOOKUP seems to be working fine in this scenario.

=INDEX(Categories,MATCH(A2,Items,0))

would be an equivalent formula.

Would you elaborate on "jams excel some"? Slowing down, perhaps?
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,248
Members
452,900
Latest member
LisaGo

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