count entityreference multivalue field conicidences (make an attendance form)
Solved. This is what I did. In order to not make heavy loads i enebleded Entity Construction Kit (eck) module, then by rules i added an entity (instead of a node) for every user entity reference value, within two columns, one for user name, and one for date in attendance. Now I can have a view (of entities) with two exposed filter on dates (beginning and ending dates) Then I override my views table tpl view with the following code. It displays a 2 column table, first: username, second: number of days that user has attendance.  the following code assumes that username is second field on your view ($fieldloop == 2 ). code:

&lt;?php $names = array(); ?&gt;


   
     
  
  
  

&lt;?php foreach ($rows as $row_count =&gt; $row): ?&gt;
   &lt;?php $fieldloop = 1; ?&gt;
    &lt;?php foreach ($row as $field =&gt; $content): ?&gt;          
    &lt;?php if ($fieldloop == 2 ) {$names[] = strip_tags($content);} ?&gt; 
    &lt;?php $fieldloop = $fieldloop + 1; ?&gt;          
    &lt;?php endforeach; ?&gt;              
&lt;?php endforeach; ?&gt;

  &lt;?php $attendances = (array_count_values($names)); ?&gt;
&lt;body&gt;
&lt;table&gt;
&lt;tr&gt;&lt;th&gt;Alumno&lt;/th&gt;&lt;th&gt;# dias&lt;/th&gt;&lt;/tr&gt;
&lt;?php foreach ($attendances as $attendance =&gt; $value) : {
?&gt;&lt;tr&gt;&lt;td&gt;  &lt;?php print $attendance ; ?&gt;&lt;/td&gt;
&lt;td&gt; &lt;?php print $value; ?&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;?php } endforeach; ?&gt; 
&lt;/table&gt;
&lt;/body&gt;