Skip to main content
MedCalc
Mail a PDF copy of this page to:
(Your email address will not be added to a mailing list)
working

ISUNIQUE function

ISUNIQUE([listID,]var) returns the logical value 1 (TRUE) if the current value of var is the first occurrence encountered during processing.

In statistical analyses, cases are evaluated sequentially from top to bottom. If a specific value (e.g., "FOO") appears multiple times in the variable var, ISUNIQUE will return 1 (TRUE) for the first instance of "FOO". For all subsequent instances of "FOO", the function returns 0 (FALSE).

This function is designed for use in filters and cannot be used directly within spreadsheet cell formulas.

Optional parameter listID

If you use ISUNIQUE for different variables in the same statistical procedure, you should use different values (1 to 10) for the optional parameter listID to ensure their 'seen' values are tracked independently.

  • Without List IDs: If you used both ISUNIQUE(City) and ISUNIQUE(Year) without list IDs, the internal "Seen Values" list might get confused, trying to check if a "Year" has already been seen in the "City" list.
  • With List IDs: ISUNIQUE(1,City) AND ISUNIQUE(2,Year) ensures the program keeps separate lists of Cities and Years.

Related functions