hi
your condition in the scalpit rank
IF(OR(market_ubnum=0,market_mbnum=0),0,si)
should be
IF(AND(market_ubnum=0,market_mbnum=0),0,si)
because when it is or it does'nt matter if you have a matched bet or not, because it is one or the other, so si will always be 0 unless you have 1 matched bet and 1 unmatched bet.
when it is AND , then there has to be no bets placed, so si=0 else si
mcbee