Your issues can be resolved by using Apps Script and writing a script.
The first function will be to create the drop down menu with the values you wanted using the .newDataValidation()
method.
function createDropdown() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var rangeRule = SpreadsheetApp.newDataValidation().requireValueInList(['Livery','Operator','Name'],true).build();
ss.getRange('I1').setDataValidation(rangeRule);
}
The second function will be used to update the I cell
based on the selection from the K cell
.
//the installable trigger
function onEditTrigger(e) {
var sheet = e.range.getSheet();
var cellValue = e.range.getValue();
var liveryOptions = ['livery1', 'livery2', 'livery3', 'livery4'];
var operatorOptions = ['operator1', 'operator2', 'operator3', 'operator4'];
if (cellValue == 'Name') {
SpreadsheetApp.getUi().alert('Input your name in the K1 cell');
sheet.getRange("K1").setDataValidation(null);
sheet.getRange("K1").clear();
sheet.getRange("K1").setBackground("yellow");
} else if (cellValue == 'Operator') {
sheet.getRange("K1").setBackground("white").setValue("Choose an option");
var dataValidation = SpreadsheetApp.newDataValidation().requireValueInList(operatorOptions, true).build();
sheet.getRange("K1").setDataValidation(dataValidation);
} else if (cellValue == 'Livery') {
sheet.getRange("K1").setBackground("white").setValue("Choose an option");
var dataValidation = SpreadsheetApp.newDataValidation().requireValueInList(liveryOptions, true).build();
sheet.getRange("K1").setDataValidation(dataValidation);
}
}
In order for your drop down selection to work, you should add an installable trigger to the second function.
You can go to your project's triggers and create a new trigger with the following properties:
When you run the script, you will only have to run the createDropdown()
function as the trigger will run continuously in the background.
Here is how the script works:
When Livery
is selected
When Name
is selected an Alert prompt
will show up asking the user to input the data on the cell
Furthermore, here are some links that might help you:
Installable Triggers;
DataValidation Class;
Apps Script.