Solving stored logic function if value is equal target value