I have written a long If function in a Cell in an Excel 2003
worksheet.
I wish to add to it but, Excel is telling me that my function is too long.
Does anybody know how to simplify or reduce the length of the function?
In Column K3
, I have a drop down list of Types of Defect, then this IF function is in column L3 to appear a specific Defect Description based on the Types of Defects selected in column K3
.
=IF(ISTEXT(K3)=TRUE,IF(OR(K3="Abnormal Finishing",K3="Bending Mark",K3="Bent",K3="Contamination",K3="Crack",K3="Damage",K3="Dented",K3="Discoloration",K3="Finger Print",K3="Flow Mark",K3="Gap",K3="Insufficient Paint",K3="Scratches",K3="Rusty",K3="Stain Mark",K3="Standoff Mark",K3="Tool Mark",K3="Warpage",K3="Water Mark",K3="White Mark",K3="White Spot"),"Cosmetic",IF(OR(K3="Angle Out",K3="Dimension Out",K3="Fitting Problem"),"Dimension",IF(OR(K3="Assembly Misalignment",K3="Fan Broken",K3="Fan Not Functioning",K3="Assembly Wrong Orientation",K3="Missing Component",K3="Missing Rivet (Assembly)",K3="Part Warping (Assembly)",K3="Rivet Loose (Drop) (Assembly)",K3="Rivet Wrong Location (Assembly)",K3="Rivet Wrong Orientation (Assembly)",K3="Screw Loose (Drop)",K3="Screw Stuck"),"Assembly","ERROR"))),"ERROR")
I usually find that multiple
IF
statements can be avoided using aVLOOKUP
function. You need your conditions and results in a table like this:Paste into A4:A39
Paste into B4:B39
Then you can use the following formula: