Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如果excel中的函数太长。如何简化?_Excel_Function_If Statement_Excel 2003_Simplify - Fatal编程技术网

如果excel中的函数太长。如何简化?

如果excel中的函数太长。如何简化?,excel,function,if-statement,excel-2003,simplify,Excel,Function,If Statement,Excel 2003,Simplify,我在excel2003工作表的单元格中编写了一个长If函数 我想添加到它,但Excel告诉我,我的函数太长了 有人知道如何简化或缩短函数的长度吗 在列K3中,我有一个缺陷类型的下拉列表,然后此IF函数位于列L3中,根据列K3中选择的缺陷类型显示特定的缺陷描述 =IF(ISTEXT(K3)=TRUE,IF(OR(K3="Abnormal Finishing",K3="Bending Mark",K3="Bent",K3="Contamination",K3="Crack",K3="Damage",

我在
excel2003
工作表的单元格中编写了一个长If函数

我想添加到它,但Excel告诉我,我的函数太长了

有人知道如何简化或缩短函数的长度吗

列K3
中,我有一个缺陷类型的下拉列表,然后此IF函数位于列L3中,根据
列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")

一种简单的方法是制作单独的列表,并检查列表中是否存在
K3
。例如,在任何列(此处为J)中列出

  • 异常整理
  • 弯痕
  • 弯曲的
  • 污染
  • 使用此公式检查此列表中是否存在K3中的值

    =IFERROR(匹配(K3,J11:J14,0)>0,FALSE)

    J11:J14
    是我的列表。公式结果为
    TRUE
    FALSE

    您的最终公式如下所示

    =IF(ISTEXT(K3),IF(IFERROR(MATCH(K3,L3:L7,0)>0,FALSE),"Cosmetic",IF(IFERROR(MATCH(K3,M3:M7,0)>0,FALSE),"Dimension",IF(IFERROR(MATCH(K3,N3:N7,0)>0,FALSE),"Assembly","ERROR"))),"ERROR")
    
    在哪里

    L3:L7
    M3:M7
    N3:N7
    是国内、尺寸和装配标准的列表


    这可能是第一个解决方法。

    我通常发现使用
    VLOOKUP
    函数可以避免多个
    IF
    语句。您需要在如下表格中填写条件和结果:

    粘贴到A4:A39中

    Abnormal Finishing
    Bending Mark
    Bent
    Contamination
    Crack
    Damage
    Dented
    Discoloration
    Finger Print
    Flow Mark
    Gap
    Insufficient Paint
    Scratches
    Rusty
    Stain Mark
    Standoff Mark
    Tool Mark
    Warpage
    Water Mark
    White Mark
    White Spot
    Angle Out
    Dimension Out
    Fitting Problem
    Assembly Misalignment
    Fan Broken
    Fan Not Functioning
    Assembly Wrong Orientation
    Missing Component
    Missing Rivet (Assembly)
    Part Warping (Assembly)
    Rivet Loose (Drop) (Assembly)
    Rivet Wrong Location (Assembly)
    Rivet Wrong Orientation (Assembly)
    Screw Loose (Drop)
    Screw Stuck
    
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Dimension
    Dimension
    Dimension
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    
    粘贴到B4:B39

    Abnormal Finishing
    Bending Mark
    Bent
    Contamination
    Crack
    Damage
    Dented
    Discoloration
    Finger Print
    Flow Mark
    Gap
    Insufficient Paint
    Scratches
    Rusty
    Stain Mark
    Standoff Mark
    Tool Mark
    Warpage
    Water Mark
    White Mark
    White Spot
    Angle Out
    Dimension Out
    Fitting Problem
    Assembly Misalignment
    Fan Broken
    Fan Not Functioning
    Assembly Wrong Orientation
    Missing Component
    Missing Rivet (Assembly)
    Part Warping (Assembly)
    Rivet Loose (Drop) (Assembly)
    Rivet Wrong Location (Assembly)
    Rivet Wrong Orientation (Assembly)
    Screw Loose (Drop)
    Screw Stuck
    
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Cosmetic
    Dimension
    Dimension
    Dimension
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    Assembly
    
    然后可以使用以下公式:

    =IFERROR(VLOOKUP(K3,$A$4:$B$39,2,0),"ERROR")
    

    此解决方案的一个优点是,可以很容易地将项目添加到每个列表中。如果您正在执行列表,还可以执行类似于
    列J
    缺陷和
    列K
    类型的操作。因此,一个带有
    VLOOKUP
    的简单的
    IFERROR()
    也可以很容易地添加项目,并且它会进一步缩短公式