I am no expert on such systems. But it seems to me that the comparisons should only be run within the cells. The caller only passes the one to compare it to, and the only thing that comes back from each cell is any matches. That way, only the specific cell has access to its data.
You might be interested in homomorphic encryption. It allows for mathematical operations on encrypted data. I don't know if any database actually supports it, but it should allow for things like SUM operations on a column of encrypted numbers with a result that is also encrypted.