Hello everyone,
sorry if I'm in the wrong room...
here is what I have

nine columns H,S,E,O, L1, L2, L3, L4, L5 and the results column "strategi"
H,S,E,O, L1, L2, L3, L4, L5 is my representation of a decision diagram, where H,S,E,O are the "fields of damage", and L1,L2,L3,L4,L5 are the "levels of severity". the fields are filled in limited to "Y" or "T".
what is going on is as such,
in the result field "strategi" I have this IIf code
Code:
IIf(
[L1]="Y","On Condition Maintenance",
IIf([L1]="T" And [L2]="Y","Preventive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="Y","Corrective Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="Y","Proactive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="T" And [L5]="Y","Redesign",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="T" And [L5]="T","Run to Failure or Redesign",
"Incorrect Input"))))))
anw this code works fine.
the problem now, I just realized that the conditions aren't the same for H, S-E, and O.
H uses 'if conditions A', which is the same as the above, S-E uses 'if conditions B', which is slightly different from the above, and O uses 'if conditions C' which is also different.
if I was to input it as a single IIf code it would be too lengthy, haven't tried it yet though.
so how can I simplify it?
what I'm trying to achieve is a such.
If H="T", then if conditions A apply,
If H="Y" and S="T" then if conditions B apply,
If H="Y" and O="Y" the if conditions C apply.
edit:
got the multiple if-s working,
Code:
=IIf
([H]="T",
IIf(
[L1]="Y","On Condition Maintenance",
IIf([L1]="T" And [L2]="Y","Preventive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="Y","Corrective Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="Y","Proactive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="T" And [L5]="Y","Redesign",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="T" And [L5]="T","Run to Failure or Redesign",
"Incorrect Input")))))),
IIf
([H]="Y" and [S]="Y" or [E]="Y",
IIf(
[L1]="Y","On Condition Maintenance",
IIf([L1]="T" And [L2]="Y","Preventive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="Y","Corrective Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="Y","Proactive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="T" And [L4]="T","Redesign",
"Incorrect Input"))))),
IIf
([H]="Y" and [S]="T" and [O]="Y" or [O]="T",
IIf(
[L1]="Y","On Condition Maintenance",
IIf([L1]="T" And [L2]="Y","Preventive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="Y","Proactive Maintenance",
IIf([L1]="T" And [L2]="T" And [L3]="T","Run to Failure or Redesign",
"Incorrect Input")))))))
still, how could this be simplified?
thanks for your help