I am assuming you are using are creating a tracker program with different events, each of them will contain the excel presented. If your goal is to have a number of the Commodities without stock, for example, in the above example as follows:
RDT 4 2 Understock
RTUF 4 2 Understock
X 5 4 Overstock
Y 3 3 (empty)
And therefore your expected value would be 2 (I am not sure why you might want that, but let’s assume it). You could create 4 PRV (Program Rule Variable), one per commodity. Create Program Rules to compare the text of your Data Element with “Oversock” and in case of true assign a “1” to the PRV. Then have a last Program Rule which adds that PRV.
A similar example (with booleans in this case) is presented here: Program rule, assign value by summing boolean data elements - #4 by jaime.bosque