linq count (list of datastructures, compared to an array value) : related to a [question I asked previously][1] (and got a great answer for)

i have a list<data_struct> roi and an array[][]avg.  the list contains an index (of course), each index contains X,Y,Z values in a data structure

i've gotten some averages and other calculations using the answers from my previous question, but now i need to (my current not working code)

    for (int i = 0;i>total;i++)
    {
      foreach (var r in roi)
       {
         if(r.X == avg[0][i]
         {
           var count = roi.Count(x=> (r.Z - 0.5) < 0);
         }
       }
     }

this returns a value, but not the correct one on my small test list

basically i'm trying to count through the list:  if the X value in the datastructure is a certain value, count how many of the Z values (indexed to that X value) meet a condition

thanks 

  [1]: http://stackoverflow.com/questions/40654590/list-of-lists-of-data-structure-how-do-i-access-with-linq