• Resolved bebo91

    (@bebo91)


    I tried the equation below, it doesn’t work
    I’m moving my google sheets equation to the plugin, but its not going as smooth when its IF OR AND condition

    IF(OR(fieldname2=””,fieldname3=””,fieldname=””,fieldname8=””),””,((fieldname1*fieldname6*fieldname7)/1728)*IF(OR(fieldname5=”small”,fieldname5=”large”),0.75,0.48))

    I have even more complicated one which is:

    IF(OR(fieldname2=””,fieldname3=””,fieldname4=””,fieldname8=””),””,IF(AND(fieldname1<=15,fieldname6<=12,fieldname7<=0.75,(fieldname10*16)<12),”small”,IF(AND(fieldname1<=18,fieldname6<=14,fieldname7<=8,fieldname10<=20),”Medium”,IF(AND(fieldname1<=60,fieldname6<=30,fieldname11<=130,fieldname10<=70),”Large”,IF(AND(fieldname1<=108,fieldname11<=130,fieldname10<=150),”MediumOV”,IF(AND(fieldname1<=108,fieldname11<=165,fieldname10<=150),”LargeOV”,”Enorm”))))))

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @bebo91

    The issue in your equation is not the “AND/OR” operations. They are fine. The problem is the equality operator. In javascript, the programming language supported by browsers, the equality operator is represented by the double symbol == because the symbol = is used for assignment. So, the equation would be:

    IF(OR(fieldname2=="",fieldname3=="",fieldname=="",fieldname8==""),"",((fieldname1*fieldname6*fieldname7)/1728)*IF(OR(fieldname5=="small",fieldname5=="large"),0.75,0.48))

    Best regards.

    Thread Starter bebo91

    (@bebo91)

    The operations run with no issues, the issues as you said its “equation error”
    the == has fixed some of the errors, out of 34 fields, i still got 2 which contains ROUNDUP function return no results
    The equation itself runs perfectly on google sheets, so its just switching to JS errors

    IF(OR(fieldname2=="",fieldname3=="",fieldname4=="",fieldname8==""),"",IF(AND(OR(fieldname5=="小号标准尺寸",fieldname5=="大号标准尺寸"),(fieldname10+fieldname13)<1),ROUNDUP((fieldname10+fieldname13)*16,0),IF(fieldname10<1,ROUNDUP((fieldname10+fieldname13),0),ROUNDUP(IF(fieldname10>fieldname14,fieldname10,fieldname14)+fieldname13,0))))
    
    

    IF(OR(fieldname2==””,fieldname3==””,fieldname4=””,fieldname8==””),””,IF(AND(fieldname5==”小号标准尺寸”,fieldname15<=6),2.7,IF(AND(fieldname5==”小号标准尺寸”,fieldname15>6,fieldname15<=12),2.84,IF(AND(fieldname5==”大号标准尺寸”,(fieldname10+fieldname13)<1,fieldname15<=6),3.47,IF(AND(fieldname5==”大号标准尺寸”,(fieldname10+fieldname13)<1,fieldname15>6,fieldname15<=12),3.64,IF(AND(fieldname5==”大号标准尺寸”,(fieldname10+fieldname13)>1,fieldname15>12,fieldname15<=16),4.25,IF(AND(fieldname5==”大号标准尺寸”,(fieldname10+fieldname13)>1,fieldname15>1,fieldname15<=2),4.95,IF(AND(fieldname5==”大号标准尺寸”,(fieldname10+fieldname13)>1,fieldname15>2,fieldname15<=3),5.68,IF(AND(fieldname5==”大号标准尺寸”,(fieldname10+fieldname13)>1,fieldname15>3,fieldname15<=20),(5.68+0.3*(fieldname15-3)),IF(fieldname5==”小号大件”,(8.66+0.38*(fieldname15-2)),IF(fieldname5==”中号大件”,(11.37+0.39*(fieldname15-2)),IF(fieldname5==”大号大件”,(76.57+0.79*(fieldname15-90)),IF(fieldname5==”特殊大件”,(138.11+0.79*(fieldname15-90)),0)))))))))))))

    • This reply was modified 3 years, 2 months ago by bebo91. Reason: Equation into code format
    Plugin Author codepeople

    (@codepeople)

    Hello @bebo91,

    Our plugin is not an Excel interpreter or emulator. So, you cannot use exactly the same Excel operations. In our plugin the equivalent to ROUNDUP is CEIL, and you don’t need the second parameter.

    The equation would be similar to:

    IF(OR(fieldname2 == "", fieldname3 == "", fieldname4 == "", fieldname8 == ""), "", IF(AND(OR(fieldname5 == "小号标准尺寸", fieldname5 == "大号标准尺寸"), (fieldname10 + fieldname13) < 1), CEIL((fieldname10 + fieldname13) * 16), IF(fieldname10 < 1, CEIL(fieldname10 + fieldname13), CEIL(IF(fieldname10 > fieldname14, fieldname10, fieldname14) + fieldname13))))

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘IF OR AND equation errors’ is closed to new replies.