• Resolved sayed

    (@319sayed)


    Please add the formula (ifs) to the plugin in Excel.
    So that we can write several conditions

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @319sayed

    Thank you very much for using our plugin. The plugin includes multiple alternatives for conditional statements.

    You can use the IF operation, if conditional statement of javascript, and javascript ternary operator.

    For example, assuming you have the operation fieldname1+fieldname2, and you want to return the result, “low” if the sum is less than 3, “medium” between 3 and 7, and “high” over 7. In this hypothetical case, the equation could be implemented as follows:

    Using nested IF operations:

    IF(fieldname1+fieldname2<=3, 'Low', IF(fieldname1+fieldname2<7, 'Medium', 'High'));

    Implementing the same equation, but using the if conditional statement and function structure:

    (function(){
    var v = fieldname1+fieldname2;
    
    if(v<=3) return 'Low';
    if(v<=7) return 'Medium';
    return 'High';
    })()

    A third alternative by using the javascript ternary operator:

    (fieldname1+fieldname2<=3) ? 'Low' : ((fieldname1+fieldname2<7) ? 'Medium' : 'High'));

    All these equations are equivalent.

    Best regards.

Viewing 1 replies (of 1 total)

The topic ‘[NSFW] formula (ifs)’ is closed to new replies.