• Resolved domainwexel

    (@domainwexel)


    Hi, is there a way to count identical (text)values in multiple fields?
    Something like “COUNTIF” function in excel? Thx.

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

    (@codepeople)

    Hello @domainwexel

    Thank you very much for using our plugin. I’ll try to describe the process with a hypothetical example.

    Assuming you have three fields in the form, fieldname1, fieldname2, and fieldname3, and you want to display “EQUAL” or “NOT EQUAL” if all these fields have the same value or not.

    Insert a calculated field in the form and enter the following equation into its settings:

    IF(AND(fieldname1==fieldname2, fieldname2==fieldname3), 'EQUAL', 'NOT EQUAL')

    For a higher number of fields (for example, fieldname1, fieldname2, fieldname3, fieldname4, fieldname5, fieldname6, fieldname7, fieldname8, fieldname9, and fieldname10), instead of including multiple pairs comparison, you can use arrays:

    
    (function(){
    var fields = [fieldname1, fieldname2, fieldname3, fieldname4, fieldname5, fieldname6, fieldname7, fieldname8, fieldname9, fieldname10],
    search = fieldname1;
    
    return IF(fields.length == fields.filter(item => { return item == search;}).length, 'EQUAL', 'NOT EQUAL');
    })()
    

    Best regards.

    Thread Starter domainwexel

    (@domainwexel)

    Thx for the quick reply and for the great support. Keep up the good work with this plugin.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Count identical values in multiple fields’ is closed to new replies.