MrExcel Publishing
Your One Stop for Excel Tips & Solutions

substitute a Letter (code) for an pre-set value

Posted by Hugo Simoes on August 14, 2001 2:15 PM

Hey guys!!! First of all I wanna thank y'all for the help with my past request and i also hope i can get help this time as well. Y'all do a fantastic job.
Would it be possible for me to have for example, in column A, a smoker/non-smoker tab, and all i wanna enter in that field is "Y" for yes and "N" for no. If they enter "y", i'd like either that same cell or in a different one to show a pre-set value.
Explaining a little better:
- In cell A1 i have the smoker/non-smoker tab.
- Either on the same cell, or in a diff one, i'd like the computer to be able to show those pre-set values as soon as it reads my "Y" or "N".
Hopefully u guys will get it, and i'll be grateful once again.
Thank you for your time!

Posted by Aladin Akyurek on August 14, 2001 2:31 PM

When you enter either "Y" or "N" in A1, you can get the pre-set values in B2 by entering in B2 an IF formula:

=IF(ISBLANK(A2),"",IF(A2="Y",pre-set value for yes,Pre-set value for no))

Is this what you are looking for?


Posted by Horacio on August 14, 2001 2:58 PM

You can also do this...

Posted by Mark W. on August 14, 2001 3:25 PM

Just so you know your options...

Why not setup data validation (see the Data
Validation... menu command)? You could place
the text values {"Smoker";"Non-Smoker"} in some
hidden cells; set the allow field to List; set
the Source field to the cell range containing
{"Smoker";"Non-Smoker"}; check both "Ignore blank"
and "In-cell drowndown"; and specify an input
message such as "Are you a smoker or a non-smoker?".