Remember you can 'nest' lots of IF statements all together depending on what version of excel you use so even without VBA you can make complicated 'bots' . It's generally best to do some kind of flow chart so you can keep track, so if you're first statement comes up true that response could also contan a nested IF statement and so on like these examples
http://www.excel-easy.com/examples/nested-if.htmlYou also have plenty of other criteria you can apply like AND or OR etc The simplest way for you to see if a bet is matched would be to compare the stake in Column S with the Matched Stake in column W if the stae is a static amount and doesn't change with some formula.
So in say column AA5 down you'd have a simple IF
=IF(W5=S5,1,0) but that would show as 1 if both columns showed 0 so we need to add additional criteria, something like an AND statement gives us the option to set the amount should be over 0 so now we have
=IF(AND(W5=S5,S5>0),1,0) which just gives us the AA column filled with 0's and 1's which we can easily add up to see if 2 or more bets have been matched using a SUM formula
SUM($AA$5:$AA$100) ( The $ sign stops the cells references from being changed when copying).
So to put all those parts together we'd always start with looking to protect our bank at all costs so try not to have backing or cancelling routines hidden away deep in complicated formulas unless you're sure of what you're doing. So we'll have a simple IF statement that cancels bets if 2 bets have been matched
=IF(SUM($AA$5:$AA$100)>=2,"CANCEL",FALSE)
In the FALSE we'll stick you're betting routine of firing when AA1=1
=IF(SUM($AA$5:$AA$100)>=2,"CANCEL",IF($AA$1=1,"BACK-IP",FALSE))
So that would be copied down your trigger column Q from Q5 down to say Q50 and in coumn AA5 to AA50 you'd copy =IF(AND(W5=S5,S5>0),1,0) ensuring that the relative cells changed i'e' in column AA6 the cell references read as =IF(AND(W6=S6,S6>0),1,0) etc