Computed field - count number of taxonomy terms in term reference field
Your first code was correct as far as it went: count($entity-&gt;field_termref) will return a count of one because the array has only one item, the list of terms.

To count the members of the list your will need to drop down into the array to actually count the list:

$entity_field[0]['value'] = count($entity-&gt;field_termref[LANGUAGE_NONE]);


The members of the list can then be counted:

$entity-&gt;field_termref[LANGUAGE_NONE][0]
$entity-&gt;field_termref[LANGUAGE_NONE][1]
$entity-&gt;field_termref[LANGUAGE_NONE][2]
...etc