Avoid multiple spreadsheets
One way of counterbalancing blocks in an experiment is to have an outer loop which points to a spreadsheet which contains the names of different spreadsheets to use in an inner loop. The main issue with this is that if you have multiple spreadsheets with the same columns and you want to make a change, you have to make it to all of them. The other more minor issue is that you may have to specify the spreadsheets as additional resources in Experiment Settings / Online.
Instead, what I recommend is to have the spreadsheet attached to the outer loop contain the rows that you want to use in a single spreadsheet attached to the inner loop and use the Selected Rows parameter.
There are two ways to specify rows. Both use the row index, which is the row number in Excel minus 2 (row 1 contains the column titles, row 2 contains the first condition which is index 0).
I usually use the variable $useRows in Selected Rows (note that a $ is needed in the parameter field).
useRows = '0:10'
specifies the first ten conditions, with indices from 0 to 9
useRows = '10:20'
specifies the second ten conditions, with indices from 10 to 19
etc.
The alternative method is for useRows to be a list of indices
useRows = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
specifies the first ten conditions, with indices from 0 to 9
useRows = [10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
specifies the first ten conditions, with indices from 10 to 19
The advantage of the list method is that you can change the order, skip rows or even duplicate them. If you set the loop type itself to sequential then you can randomise the order with constraints before the loop starts. I use this for my Complex Randomisation and Repeat Subset online demos.
Complex Randomisation code | try it | discussion thread
This demo is for anyone who wants to randomise the order of their trials with constraints, and can do so based on the row numbers. In this case the demo produces CVC letter strings by shuffling rows 0 to 4 for the vowels and 5-25 for the consonant, and then adding appropriate items to useRows. The loop itself is sequential. The advantage of this method over preloading stimuli is that it does not require extra loops or lists – the trials loop itself is attached to the conditions spreadsheet as normal.
Repeat Subset code | try it | discussion thread
Adds errors made during the first loop to a list which used by the second loop, so that only incorrect trials are repeated.