PDA

View Full Version : Excel 2000



Forrest
15-07-2002, 04:40 PM
I am trying to work out a formula in Excel 2000 that will automatically select the customer number when a customer name is selected from a list.

I have set up the form so that when a user reaches the Customer cell they are prompted to select a customer name from a drop down list (I generated the list by using the 'list' function in data validation).

I have tried using the IF function but am unsure of applying this formula to a list of 50 customer names and numbers (IF can cope only with 7 variables?).

Would VLOOKUP be more suitable? Any help would be most appreciated!

B/rgds and many thanks in advance.
Forrest

godfather
15-07-2002, 04:48 PM
give your customer list array, plus the next column which contains the number, a name (i.e."custno")

Use vlookup:

=vlookup(entered_customer_name,custno,2,false)

This should return the number adjacent (to the right of) the matching customer name (in column 2 relative to the name).

wuppo
15-07-2002, 05:00 PM
One way to achieve this:
Create a two column list somewhere on your sheet, of Customer Names and customer Numbers.
Add a Combo Box to the sheet from the Control toolbox Toolbar.
Click the Design mode on the Control Toolbox Toolbar, rightclick the Combo Box and select Properties.
Under 'Linked Cell' enter the cell reference where you want the result posted.
Under 'ListFillRange' enter the 'array' range for your customer data (e.g G10:H20)
Under 'BoundCloumn' enter 2 (column in array for Customer Number)
Under ColumnCount enter 2
Under ColumnWidths enter ;0 (to hide second column in combo box)

Click out of Design Mode and try :)

Forrest
26-07-2002, 04:58 PM
Many many thanks for your replies both solutions worked a gem. :)