Embedding excel spreadsheets in your experiment
In many judgment and decision-making experiments, participants are asked to make judgments about complex valuations that are computed using financial models. For instance, Elliott, Fanning, and Peecher (2019) ask participants to derive the fundamental value of a firm using a Residual Earnings Model. Next to that, in a recent study of Bart Dierynck and myself we ask auditor participants to audit a Level 3 Fair Value Estimate of a patent that was computed using a Discounted Cash Flow model. As such models are computationally complex, experimenters need to offer the participants the right tools to compute the value of interest. As it can be challenging to embed calculating tools in an experiment, most researchers resort to pen-and-paper experiments or ask participants to open Excel outside of the experimental environment. In this post, I show how you can easily embed a working spreadsheet in your experimental environment.
An example of a spreadsheet embedded in the experiment of Dierynck and Peters (2019)
Preparing your Spreadsheet Using OneDrive
In order to embed an Excel spreadsheet in your experiment, we use the embed-function of OneDrive. If you do not have a OneDrive account yet, you can sign up for free. Upload the Excel sheet that you would like to use to ‘Files’. Once the file is uploaded, you can right-click on the file and subsequently click on ‘Embed’. A sidebar will open in which a link is provided that you can use in your experiment, as you may want to customize how your spreadsheet appears to others you can click on this link. In this option menu there are several options, such as whether you want to show the entire spreadsheet or only a certain range. Also, you can adjust whether you want participants to be able to edit the spreadsheet. Once you have customized the spreadsheet, you can copy the code in either HTML or JavaScript format.
Options in OneDrive for Customizing your Spreadsheet
Embedding the Spreadsheet in your Experiment
When you are ready preparing your spreadsheet in OneDrive and copied the link to your (customized) spreadsheet, you can insert the spreadsheet into your experiment. In your experimental software you can insert your spreadsheet by using the HTML code of your spreadsheet:
<div align="center>
<iframe width="125%" height="430" frameborder="0" scrolling="no" src="https://onedrive.live.com/embed?resid=2FB8EDA965ED41FA%216017&authkey=%21AKLmN-TwOKgCDeI&em=2&AllowTyping=True&ActiveCell='Audit of Robofer Patent'!A1&Item='Audit of Robofer Patent'!A1:I19&wdInConfigurator=True&waccluster=NL3"></iframe>
</div>
If your experimental software uses JavaScript instead, you can use the following syntax:
<div id="myExcelDiv" style="width: 125%; height: 430px"></div>
<script type="text/javascript" src="https://onedrive.live.com/embed?resid=2FB8EDA965ED41FA%216017&authkey=%21AKLmN-TwOKgCDeI&em=3&wdDivId=%22myExcelDiv%22&wdHideHeaders=1&wdActiveCell=%22'Audit%20of%20Robofer%20Patent'!A1%22&wdAllowInteractivity=0&wdAllowTyping=1"></script>
Below, you can see an example of the embedded spreadsheet used in Dierynck and Peters (2019) for demonstration purposes. You can go ahead and try to edit some numbers.
The spreadsheet embedded in Dierynck and Peters (2019)
Some Tips and Tricks
It is important to note that since you are working with an embedded file – presumably with multiple participants at the same time – the spreadsheet cannot be saved. Hence, instead you should create variables using your experimental software in which you can ask your participants to fill in the variables of interest. Also, in order to show the embedded spreadsheet participants need to be connected to the internet as the spreadsheet is retrieved from the OneDrive server.
References
Dierynck, B., & Peters, C.P.H. (2019). Auditor Task Selection under Time Pressure. Available at: https://ssrn.com/abstract=3450363. Elliott, W. B., Fanning, K., & Peecher, M. E. (2019). Do Investors Value Higher Financial-Reporting Quality, and Can Expanded Audit Reports Unlock This Value?. The Accounting Review, In-Press.