Dropdown selection that returns a different value based on selection.

jmk15315

Board Regular
Joined
Nov 7, 2021
Messages
73
Office Version
  1. 2013
  2. 2010
Platform
  1. Windows
Good morning.

I have been working to figure out the best way to accomplish what should be a simple task.

I have a spread sheet that column "J" is used to populate a code for the item selected. The issue is, that this code varies based on the category of the selection. The user knows this category by name, but our operations team knows it by a code. For example: Stands are code FG0700, Electrical Systems are code FG1000 and so on. I was hoping I could create a dropdown list by using Data Validation, but I am not able to have it return the correct value.

I would like for Cell "J" to have a dropdown that shows the name (Stands, Electrical Systems, etc...) and when selected it would populate cell "J" with the corresponding code (FG0700, FG1000, etc...)

I welcome any thoughts.
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
maybe a lookup table with the
names in 1 column and the code in the next column
but that would then return the result into a different column based on the dropdown
otherwise , likely to be VBA as you will have contents in the cell and want to change the result - i thought of choose / switch et
 
Upvote 0
I tried creating a table and then pointed the dropdown to the column with the names, this works fine, but it does not populate the cell with the Code that corresponds with the name. It only gives me the name. I am not understanding how to have the dropdown list show the "Name" but populate the cell with the "Code"
 
Upvote 0
as i mentioned , i dont think you can have the same cell change , without VBA , I maybe wrong

but you can populate another column as shown
A1 is the text, using datavalidation LIST and then in B1 you get the code from a lookup

Book2
ABCDEFG
1c3
2a1
3b2
4c3
5d4
6e5
Sheet1
Cell Formulas
RangeFormula
B1B1=INDEX(G2:G6,MATCH(A1,F2:F6,0))
Cells with Data Validation
CellAllowCriteria
A1List=$F$2:$F$6
 
Upvote 0
1721054416128.png


I think you and I are on the same page. It may not be possible to have the "dropdown"cell with the "name" be the same as the cell with the value "Code".

I created a seperate "Selection" cell (Column P) to populate the name then used VLOOKUP to get the value from the table of codes and populate the cell in (Column J)
 
Upvote 0
glad its solved for you - but as i say I wonder if VBA (I do not provide solutions on forums) may work as you wish
 
Upvote 0

Forum statistics

Threads
1,223,877
Messages
6,175,138
Members
452,614
Latest member
MRSWIN2709

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