Converting Spreadsheets from Microsoft Excel
Contents
Introduction
Don't just import your existing spreadsheets, convert them.
Once you have Resolver One up and running, it's easy to import your Microsoft Excel spreadsheets; just select File > Import From Excel (With Formulae):

Resolver One supports most MS Excel features, so your existing documents should work immediately. However, if you stop there, then you're missing the full power of Resolver One.
This tutorial is about not merely importing, but converting your existing spreadsheets, making them easier to read and maintain, and less prone to errors. It covers common difficulties and demonstrates key ways Resolver One can enhance your spreadsheets.
If you get stuck, feel free to ask on our support forums.
Download and open the example spreadsheet
For this tutorial, you'll need the sample spreadsheet from the Resolver Exchange:
Click to download Excel Examples
Open the tutorial.xls in MS Excel or a compatible spreadsheet and take a look.
The spreadsheet uses (strictly for illustrative purposes) formulae to calculate tax for a list of employees. The first worksheet lists employee reference numbers and departments. The second (shown below) adds pay grade and tax code information. With the help of some dynamic lookups it calculates how much tax they pay:

The first worksheet makes extensive use of VLOOKUP and INDEX and MATCH functions. Unless you know exactly what these do, the formulae are hard to understand. Worse, they contain several hardcoded cell range references—these may break when you add more data.
Close Excel and open Resolver One.
Moving this spreadsheet to Resolver One lets us simplify it. This makes it easier to understand and maintain, and makes it less likely that errors will be introduced when new employees are added.
Import from Excel
The first step in converting an Excel spreadsheet to Resolver One is to import it. The File menu has options to import from Excel, with or without formulae. In our case we want to import with formulae.
Select File > Import From Excel (With Formulae).
Navigate to the file tutorial.xls and click Open.
The imported spreadsheet looks very similar to the original:

So far we have the spreadsheet loaded and working as if in MS Excel. Now it's time to enhance it using the full power of Resolver One.
Column Level Formulae and Headers
At the heart of the example spreadsheet is the big table in the 'Employee Data' worksheet. It has one row per employee, like this:
| Reference | Name | Dept | Grade | Tax Code | Tax Paid |
|---|---|---|---|---|---|
| #127 | William Adama | Accounting | 1 | B | $10,000 |
Formulae supply the values in the 'Dept' and 'Tax Paid' columns. When you add a new employee, you have to remember to paste the formulae into the right cells—rather easy to forget. There are several steps towards fixing this.
Column Level Formulae
Column Level Formulae apply to entire columns, without the need to fill down when new data is added. Let's see them in action.
The 'Dept' column
The formula in the 'Dept' column uses the VLOOKUP function to look up the employee's department from the 'Employees' sheet via their reference number:
=VLOOKUP(A3,Employees!$A$1:$B$22,2,False)
This is not exactly intuitive.
We can make it easier to understand by turning the first row and column on the Employees worksheet to Header Rows and Columns:
In the Employee data sheet, right-click in Row 1, and select Set Header Row (1).
Clear the formulae from the Dept column, select the entire column, then enter the column formula., =workbook['Employees']['Dept', #Reference#_].
This formula uses header indexing to look up the department ('Dept') from the Employees worksheet given an employee reference.
The 'Tax Paid' column
The 'Tax Paid' column contains this wonderful formula:
=VLOOKUP(E2,$H$11:$I$17,2,False)*VLOOKUP(D2,$H$1:$I$6,2,False)
This looks up the employee's annual income from their pay grade and multiplies this by the percentage of tax they pay, based on their tax code.
This will make much more sense if we use named ranges combined with column formulae that incorporate header row names.
Select the range H1:I5
Select Data > Edit Names to open the Edit Names window, then click New and name the range "paygrade".
Click OK.
Select the range H11:I17
Select Data > Edit Names to open the Edit Names window, then click New and name the range "taxcode".
The window should look like this:

Click OK.
Resolver One automatically treats the top row and left-hand column of a named range as headers.
Clear the formulae from the Tax paid column, select the entire column, then enter the column formula: =taxcode['Percentage', #Tax Code#_] * paygrade['Annual Salary', #Grade#_]
The result isn't any shorter, but it's much more understandable. Also, it appears in only one place and so is easier to maintain.
Use the Output Pane to Debug
The red crosses in cells (see the image above) indicate the location of any errors. Hovering the mouse pointer over the cell tells you about the particular error. Usually this is a function that is missing because it was either not compatible with Resolver One or involved VBA code—both easily resolved.
The quickest way to locate errors is to work through the messages in the output pane at the bottom of the user interface. In addition to print statements, this shows error messages as full Python tracebacks giving you the problem line number or cell reference:

Use the pane to rapidly debug even the most complex spreadsheets comprising multiple worksheets. As you fix issues, the number of tracebacks should decrease until you are error free.
Using Worksheet Indexing to replace Index Match
The first worksheet lets you enter an employee name in cell E3 and see how much tax they paid in cell E4.
The formula in E4 uses common Excel functions MATCH to find the required row, and INDEX to index a specific column in that row: =INDEX('Employee Data'!A1:F22,MATCH(E3,'Employee Data'!B1:B22,False),6). There is a simpler way, using Resolver One's header indexing.

The INDEX and MATCH functions will be available soon, but you're almost always better using Resolver One's header indexing.
Select cell E3.
Select Data > Edit Names to open the Edit Names window.
Name the range "employee" and click OK.
Turn the Name column into a header column.
Replace the formula in cell E4 with =<'Employee Data'>['Tax Paid', employee].
This isn't just shorter, it's also easier to understand and doesn't hardcode any cell or range locations.
More about the formula
The syntax: <'Employee Data'> uses angle brackets to indicate that the source worksheet must be calculated before the formula itself. This is called dependency analysis—you only want the formula to be calculated once the worksheet has been fully calculated.
In an earlier formula we used a different syntax, workbook['Employees']. When looking up the department from an employee reference in the =workbook['Employees']['Dept', #Reference#_] we are not dependent on any formulae. This means we are safe to use the square brackets indexing, in turn avoiding a circular dependency between two worksheets referencing each other.
Conditional Formatting from User Code
Excel conditional formatting doesn't import into Resolver One, but it's easy to add with a simple bit of Python in the Post-formulae user code section.
The original Excel spreadsheet uses conditional formatting to highlight employees who pay more than $15,000 in tax.
- In the Post-formulae user code section, enter the following Python code:
for row in workbook['Employee Data'].ContentRows:
if row['Tax Paid'] > 15000:
row.Cells['Tax Paid'].BackColor = Color.LightPink
To apply the changes, click outside the coding pane, or press F9.
The effect is identical to the conditional formatting applied in the Excel spreadsheet.
About the code
This code iterates over every row in the 'Employee Data' workbook, using ContentRows to skip over the header row. If the 'Tax Paid' cell in the row is greater than $15,000 then the cell is coloured in LightPink.
Further Improvements
We've now converted the example spreadsheet from Excel to Resolver One. However, there's still room for improvement:
- How about some pre-formulae user code to automatically copy the reference numbers from the 'Employees' sheet into 'Employee Data'? That way the reference numbers only need be entered once.
- Better still, the data could be entered and stored in a single master workbook and accessed using RunWorkbook. This would enable reuse by other workbooks.
- It would also be useful to have some validation user code to raise errors if data is missing.
Implementing all this is left as an exercise for the reader. If you come up with something elegant, we'd love you to submit it to the Resolver Exchange.
Comments
If you have comments, questions or suggestions about any of the Resolver One documentation, please post them to the Documentation Suggestions Forum.
