I have costs associated with apple1,2,3,4. So apple1 costs 50 coins, apple2 costs 100 etc..
so I end up using max(right()) to get the highest fruit, then I use find() to match the number back to the string. then I have my 'best' string, then I use left() to figure out which fruit it is AND right() to get the cost THEN FINALLY subtract that from your bank.
it's complicated! It;s for the game's AI to buy the best fruit. It's working but I know its going to be hard to understand when I look at this again in 6 months! writing the best comments I can!