If you store those values in an array, then you can use indexOf
to find the match:
function getLocationNumber(location) {
var locationOptions = ["Inland", "Great Lakes", "Rivers", "Coastal", "N/A"];
var locationNumber = locationOptions.indexOf(location) + 1;
return locationNumber;
}
// Example:
getLocationNumber("Great Lakes") // returns 2
getLocationNumber("Coastal") // returns 3