> For the complete documentation index, see [llms.txt](https://docs.coherent.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherent.global/assistant/solver/creating-a-solver.md).

# Creating a solver

Spark solver to perform a *What-If Analysis* similar to [Goal Seek](https://support.microsoft.com/en-us/office/use-goal-seek-to-find-the-result-you-want-by-adjusting-an-input-value-320cb99e-f4a4-417f-b1c3-4f369d6e66c7) at each API call. This is useful to determine the needed value to achieve a target input. For example, Goal Seek could be used to determine how long it would take to pay off a certain loan amount.

Users can build a simple solver that works similarly to Excel’s Goal seek function in order to perform a What-If Analysis. This solver is recognized by Spark and returns the forecasted value.

* For example, to reach a specific goal for the amount of annual premium paid by changing the sum assured. This is an effective method to find out how much an individual can be assured for, with a premium constraint.
* If a Spark Service has multiple solves, they will be executed in alphabetical order.

### How to create a solver block?

1. Navigate to the **Solver** application.
2. Click on **Create a solver**.
3. Select the **target cell** and the **changing cell.** Select the algorithm you wish to use, and the value you wish to target.

<figure><img src="/files/wHECwmJ0Uowqd8rQbMh7" alt="" width="368"><figcaption></figcaption></figure>

4. Select an empty area that is at least 2 cells wide, and 13 cells long.

{% hint style="info" %}
You can rename the solver by changing the **XSolve\_\[address]** before creating or changing it through the name manager.
{% endhint %}

5. Once the indicator is green, click on the **Create** button to add the solver block to your selection.

### Solver Block Parameters

<table><thead><tr><th width="193">Key</th><th>Value</th></tr></thead><tbody><tr><td><code>Run if</code></td><td>A <code>TRUE</code> or <code>FALSE</code> value indicating whether or not this solve should be executed.</td></tr><tr><td><code>Target Cell</code></td><td>A link to the formulated cell that needs to reach the <code>Target value</code>. This is generally recommended to be defined as a difference between the desired <code>Target value</code> of <code>0</code>.</td></tr><tr><td><code>Target value</code></td><td>The value of the <code>Target cell</code> to achieve. This is best set to <code>0</code>.</td></tr><tr><td><code>By changing</code></td><td>A link to the cell that has to change in order to for the <code>Target cell</code> to reach the <code>Target value</code>.</td></tr><tr><td><code>Solve algorithm</code></td><td>The available options are <code>SECANT</code>, <code>STOPSATZERO</code>, <code>SMARTSECANT</code>, <code>BRENT</code>.</td></tr><tr><td><code>Max change</code></td><td>Maximum acceptable value of <code>|Solve result - Target value|</code> within <code>Max iterations</code>, default <code>1</code>.</td></tr><tr><td><code>Max Iterations</code></td><td>Maximum iterations for the number of solve.</td></tr><tr><td><code>Initial guess</code></td><td>Provide an initial guess to help reach the <code>Target value</code> sooner.</td></tr><tr><td><code>Solve Started</code></td><td><code>TRUE</code> or <code>FALSE</code> value. Spark will write this into the cell during execution. This enables downstream calculations to use this value.</td></tr><tr><td><code>Solve target</code></td><td>This is provided in order to help assess how close the solve was in reaching the target, given the solve can conclude within the <code>Max change</code>. Spark will write this into the cell during execution. This enables downstream calculations to use this value.</td></tr><tr><td><code>Solve iteration</code></td><td>Spark will write this into the cell during execution. This enables downstream calculations to use this value.</td></tr><tr><td><code>Solve result</code></td><td>This will contain either the successful solve value or <code>#N/A</code>. Spark will write this into the cell during execution. This enables downstream calculations to use this value.</td></tr><tr><td><code>Solve successful</code></td><td><code>TRUE</code> or <code>FALSE</code> value. Spark will write this into the cell during execution. This enables downstream calculations to use this value.</td></tr></tbody></table>


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coherent.global/assistant/solver/creating-a-solver.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
