The system uses a simple set of switches. On the original xls sheet I give the first two trial value fields a value of -99. I then use the following equation to make sure that the randomization on the xls file only happens once:
Cell B2 - " =IF(AND(B62<>-99, B63=-99),(INT(RAND()*4))+1,B2) "
The above syntax tells the xls sheet that it will only randomize if the first trial doesn't have a value of -99, and the second trial does have a value of -99. This scenario will only take place once on the excel sheet (when MediaLab first changes the value -99 and then moves onto change the next). Once MediaLab assigns different values to the fields marked with a value of -99, we set on a switch. The data files never change because the excel sheet will never randomize unless both the first and second trial contain values of -99.