> For the complete documentation index, see [llms.txt](https://www.opal-rt.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.opal-rt.com/docs/hypersim/automation-api-and-scripting/automate-using-testview/test-commands-reference/main/excel/interface-excel-with-testview.md).

# Interface Excel with TestView

<https://opal-rt.atlassian.net/wiki/spaces/PDOCHS/pages/149947765/Interfacing+Excel+with+TestView>

The **HYPERSIM Excel** step in TestView allows you to import parameter values from an Excel worksheet and automatically apply them to HYPERSIM components during test execution. It is commonly used in loops to vary parameters across iterations, but it can also be placed in the Initialization section to set initial system states.

The **HYPERSIM Excel** step:

* Imports parameter values from an Excel file.
* Updates the component/parameter list after import.
* Supports multiple parameters (multi‑parameter mode).
* Each parameter set is defined as a “subset” that is applied during iterations.
* Parameters can be reused like in a multi‑parameter Miscellaneous step.

After import:

* A **new tab** appears for each parameter group.
* Each tab contains the parameter values to be used for each iteration.
* All parameters in a tab must have the **same number of values**.\
  Tabs turn **red** if the number of values is insufficient.

<figure><img src="https://3623212549-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLxgTpoh7kyPmQ5vuyqD7%2Fuploads%2Fgit-blob-bc3b78c971f36f783a508855029ccec53604e3c0%2Fimage%20(322).png?alt=media" alt=""><figcaption></figcaption></figure>

### **HYPERSIM Excel step Interface** <a href="#id-2hypersimexcelstepinterface" id="id-2hypersimexcelstepinterface"></a>

Below is a summary of each section and field in the Import Step dialog.

## **Excel Workbook Information** <a href="#excelworkbookinformation" id="excelworkbookinformation"></a>

| Field                        | Description                                                           |
| ---------------------------- | --------------------------------------------------------------------- |
| **Excel file path**          | Path to the Excel file containing the parameters.                     |
| **Named range**              | Name of the Excel area containing the parameter table (recommended).  |
| **Sheet name and range**     | Explicit Excel range (`Sheet1!A1:G15`) used instead of a named range. |
| **Import from Excel**        | Reads the file and imports parameters.                                |
| **Auto import data on play** | Automatically imports Excel data at the start of the test sequence.   |

***

## **Parameters Section** <a href="#parameterssection" id="parameterssection"></a>

Used to select which component and parameter to add to the list.

| Field         | Description                                |
| ------------- | ------------------------------------------ |
| **Category**  | Component category (Breakers, Lines, etc.) |
| **Component** | Component name to add                      |
| **Parameter** | Parameter to modify                        |

***

## **List Section** <a href="#listsection" id="listsection"></a>

| Field           | Description                                               |
| --------------- | --------------------------------------------------------- |
| **New**         | Adds a new subset using the selected component/parameter. |
| **Subset item** | Displays all subset entries applied during iterations.    |

***

## **Subset Section** <a href="#subsetsection" id="subsetsection"></a>

| Field              | Description                             |
| ------------------ | --------------------------------------- |
| **Index**          | Loop iteration number                   |
| **Component name** | Component whose value changes           |
| **Parameter name** | Parameter modified during the iteration |
| **Value**          | Value applied to that iteration         |
| **Add / Remove**   | Add or delete an iteration row          |

***

### **3. Defining Parameters in Excel** <a href="#id-3definingparametersinexcel" id="id-3definingparametersinexcel"></a>

An Excel worksheet provides the data used by the HYPERSIM Excel block. Each iteration of a TestView loop will use a different row of values.

Two methods exist for selecting the area to import:

## **Named Range (Recommended)** <a href="#namedrangerecommended" id="namedrangerecommended"></a>

* Easiest and most readable.
* A name such as **"MyTable"** is assigned to a cell range (`A2:D4`).
* Must include header row + value rows.

## **Sheet Range** <a href="#sheetrange" id="sheetrange"></a>

* Uses explicit syntax:\
  `Sheet13!$A$2:$D$4`
* No Excel setup required, but more error‑prone.

***

### **4. Supported Data Formats** <a href="#id-4supporteddataformats" id="id-4supporteddataformats"></a>

## **4.1 Fixed Format (single parameter)** <a href="#id-41fixedformatsingleparameter" id="id-41fixedformatsingleparameter"></a>

* Only **one** parameter for **one component**.
* Column header uses `Component.Parameter` syntax.\
  Example: `BR1.T1`
* Rows contain iteration values.

## **4.2 Variable Component Format (multiple parameters)** <a href="#id-42variablecomponentformatmultipleparameters" id="id-42variablecomponentformatmultipleparameters"></a>

* Multiple parameters for a **single component type**.
* First column must be named **$** and contain the component name for each iteration.
* Additional columns are parameter names.
* Components must be of the same type and have values for all defined parameters.

Example:

| $   | Time | PhA | PhB | PhC |
| --- | ---- | --- | --- | --- |
| BR1 | 0.1  | 1   | 0   | 1   |
| BR2 | 0.12 | 1   | 1   | 1   |

## **4.3 Combining Formats** <a href="#id-43combiningformats" id="id-43combiningformats"></a>

You may combine fixed and variable formats in the same table to set multiple parameters across different component types.

***

### **5. Advanced Excel Capabilities** <a href="#id-5advancedexcelcapabilities" id="id-5advancedexcelcapabilities"></a>

## **Formulas** <a href="#formulas" id="formulas"></a>

Cells may contain Excel formulas; TestView imports only the evaluated values.\
This allows:

* Randomization (`=RAND()*0.11`)
* Mathematical expressions
* Cell references

## **Empty Cells** <a href="#emptycells" id="emptycells"></a>

Leaving a cell empty instructs TestView to **skip** that parameter for that iteration.

## **Importing Variables** <a href="#importingvariables" id="importingvariables"></a>

Columns can assign TestView variables using this syntax:

`%{myVariable}`

Variables can later be used in:

* Conditions (`If`)
* Any TestView step
* Script logic

## **Comments Column** <a href="#commentscolumn" id="commentscolumn"></a>

A column starting with `#` is ignored during import.

## **Style / Formatting** <a href="#styleformatting" id="styleformatting"></a>

Excel formatting does not affect imports; tables may appear anywhere on the sheet as long as the selected range is correct.

***

### **6. Component and Parameter Names** <a href="#id-6componentandparameternames" id="id-6componentandparameternames"></a>

To obtain valid component and parameter names:

* Open the **Netlist** in HYPERSIM.
* Example: component *Ld1* shows all supported RLC parameters.

***

### **7. Exporting Results to Excel with TableOut** <a href="#id-7exportingresultstoexcelwithtableout" id="id-7exportingresultstoexcelwithtableout"></a>

The **TableOut** step allows TestView to generate CSV or Excel files.

## **Export Modes** <a href="#exportmodes" id="exportmodes"></a>

| Mode                               | Behavior                                       |
| ---------------------------------- | ---------------------------------------------- |
| **New file**                       | Creates a new workbook and table.              |
| **Existing file, table not found** | Adds a new sheet and new table.                |
| **Existing file, table found**     | Replaces or resizes the table to fit new data. |

## **Append Mode** <a href="#appendmode" id="appendmode"></a>

Appends new sequence data to an existing table—adds new rows or new columns if required.

**Warning:** Excessive appends can create very large Excel files.

## **Read‑Only Protection** <a href="#readonlyprotection" id="readonlyprotection"></a>

Excel files must be closed before TestView writes to them.\
If the file is open, TestView creates a new file with suffixes (`_0`, `_1`, …).

***

### **8. HYPERSIM Processing Step (Reminder)** <a href="#id-8hypersimprocessingstepreminder" id="id-8hypersimprocessingstepreminder"></a>

A Processing block can be placed inside a loop:

* Each iteration assigns computed values (e.g., max of a signal) to variables.
* At the end of the loop, these variables contain vectors of results.

## **Criteria for Saving Tests** <a href="#criteriaforsavingtests" id="criteriaforsavingtests"></a>

Criteria in the Saving Mode tab determine which iterations to keep:

| Criterion        | Meaning                                              |
| ---------------- | ---------------------------------------------------- |
| **Min / Max**    | Keep iteration with minimum/maximum expression value |
| **Minf / Maxf**  | Same, but only finite values                         |
| **First / Last** | Keep first or last iteration                         |
| **Save**         | Keep all iterations where expression is true         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.opal-rt.com/docs/hypersim/automation-api-and-scripting/automate-using-testview/test-commands-reference/main/excel/interface-excel-with-testview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
