I need assistance creating a custom function in Google Sheets using JavaScript to determine the level of disagreement between survey participants.
Below is my current code snippet:
function disagree(DISAG,otherMember) {
var otherMember = '';
var indivDisag = DISAG.localeCompare(otherMember);
return Math.abs(indivDisag);
}
Despite utilizing localCompare, I am consistently receiving a value of 1 instead of the expected 0 for similar responses. Can you identify what mistake I've made?
This simple function allows me to compare the disagreement between two individuals based on their responses.
Updated for clarity.
Thank you for your guidance.