I can't think of a way to do this in a single formula without making it over complicated.
You can use
in 3 separate cells, then use =max(range) to determine the highest result from the above 3 formulae.
The only other alternative i can think of is to nest a whole bunch of "countif" and "if" statements together to test each option together to determine the final results - it would however be a very long formula!!