I don't understand fully, but what you are asking should be easily achievable by doing some comparisons using 'if'/'else'.

Care to explain further, maybe with some code.