For a slightly different approach convert your data into an Excel Table (this allows for easier data maintenance and analysis). Then, assuming the following table:
Use the following function for your bac_sp column:
=IF(AND(SIGN([gene a])=-1,SIGN([gene b])=-1,SIGN([gene c])=-1),"Rest",IF(AND(SIGN([gene a])=1,SIGN([gene b])=1,SIGN([gene
c])=-1),"Pn",IF(AND(SIGN([gene a])=1,SIGN([gene b])=-1,SIGN([gene
c])=1),"Ps","")))
Using the table allows better name usage (e.g. [gene a] rather than B2) and usage of the sign function prevents the need for explicit greater/less than comparisons. You can also create Pivot Tables based upon this and get some basic stats like count of each type of strain.
EDIT: To avoid a misunderstanding regarding the above function, please review the Excel function Sign. This function simply evaluates whether a particluar value is positive, negative or zero and returns 1,-1, or 0 respectively. So, it doesnt' matter what the coded value is, simply whether it's positive or negative. Here's a sample with more diverse sample data (and the same bac_sp formula):
As you can see, the results are the same, regardless of the coded values in the gene columns. The function's arguments of -1, 1 are based upon the possible return values of the Sign function, not based upon the values in the data table.