Ah, I do apologize. Reading variable names incorrectly can be bad.
In reference to the sums, if you add them up and they are atleast 1, then it's rare. If not, then there are no pots on the item.
For the other ranks, simply check each potential id separately if it is atleast that number.