MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Formula question from newbie


Posted by Gazza on October 21, 2001 11:03 PM

We have dropdown list of expense categories and depending on which is chosen would want a code assigned in the next column .. there are 16 different categories. What is the best way?

ie Fuel = 1, Repairs = 2, etc


Posted by Aladin Akyurek on October 21, 2001 11:45 PM

Make a 2-column table of categories and codes in a separate worksheet. Select the cells of this table, go to the Name Box on the Formula Bar,
and type CTABLE.

Assuming that you have your dropdown list in A2 in the other worksheet, you can type in B2:

=VLOOKUP(A1,CTABLE,2,0)

where 0 is the same as FALSE.

By the way, I assumed that you created your dropdown list via data
validation.

Aladin

=============

Posted by Gazza on October 22, 2001 1:05 AM

Thankyou, works fine.