# Picking random excel sheet with code for builder

**URL:** <https://discourse.psychopy.org/t/picking-random-excel-sheet-with-code-for-builder/24833>\
**Category:** Coding\
**Tags:** randomization\
**Created:** [September 5, 2021, 1:25am UTC](https://discourse.psychopy.org/t/picking-random-excel-sheet-with-code-for-builder/24833 "2021-09-05T01:25:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bjackson55](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/bjackson55/32/13067_2.png) [@bjackson55](https://discourse.psychopy.org/u/bjackson55)\
**Post date:** [September 5, 2021, 1:25am UTC](https://discourse.psychopy.org/t/picking-random-excel-sheet-with-code-for-builder/24833/1 "2021-09-05T01:25:22Z")

</div>

Hello,

I am using the builder, but am trying to add in a line of custom code so that after the instruction screen, the program picks one of the 8 excel sheets in my folder. Each sheet is a different stimulus set order and each participant only needs to complete one of the excel sheet/stimulus sets. Since I am not used to writing code and instead rely on the builder, I am in need of help figuring out how to have my code randomly picking one of the excel sheets to read from.

Any advice is welcome. Thank you.

---

<div class="post-metadata">

**Author:** ![jgeller112](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jgeller112/32/9835_2.png) [@jgeller112](https://discourse.psychopy.org/u/jgeller112)\
**Post date:** [September 5, 2021, 3:15am UTC](https://discourse.psychopy.org/t/picking-random-excel-sheet-with-code-for-builder/24833/2 "2021-09-05T03:15:08Z")

</div>

This might be of help to you:

> [@Blocks of trials and counterbalancing](https://discourse.psychopy.org/t/blocks-of-trials-and-counterbalancing/3055):
>
> Blocks of trials and counterbalancing Many people ask how to create blocks of trials, how to randomise them, and how to counterbalance their order. This isn’t all that hard, although it does require a bit of thinking! Blocking The key thing to understand is that you should not create different Routines for different trials in your blocks (if at all possible). Try to define your trials with a single Routine. For instance, let’s imagine you’re trying to create an experiment that presents a bloc…
