# VALUEATRISK

## Description

Value at risk is a currency-denominated measurement of the loss a portfolio (or financial instrument) would experience over a specified investment horizon. This is a common method for assessing risk. The Excel Lab function allows you to estimate value at risk both at the end of an investment horizon as well as throughout the investment horizon (risk measured continuously, within-horizon).

{% hint style="info" %}
See <https://insights.windhamlabs.com/insights/rethinking-exposure-to-loss> for an introduction to stress testing your portfolios and assessing a more realistic measurement of exposure to loss.
{% endhint %}

## Syntax

The following describes the function signature for use in Microsoft Excel's formula bar.

```excel-formula
=VALUEATRISK(value, mu, sigma, horizon, threshold, estWithinHorizon)
```

### Input(s)

| Argument             | Description                                                                                                                                                                          |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **value**            | Required. Vector / scalar value of portfolio wealth.                                                                                                                                 |
| **mu**               | Required. Vector / scalar value of portfolio return estimate(s).                                                                                                                     |
| **sigma**            | Required. Vector / scalar value of portfolio risk estimate(s).                                                                                                                       |
| **horizon**          | Required. Investment time horizon in the same time units of return and risk.                                                                                                         |
| **threshold**        | Required. Threshold for tail risk, this determines the area of the probability distribution to evaluate. You can interprete this as one minus your confidence probability.           |
| **estWithinHorizon** | Optional. Logical flag (TRUE or FALSE) to indicate whether you would like to calculate the within-horizon risk measurement. If this argument is not specified, it defaults to false. |

### Output(s)

Value at Risk estimate(s).

## Example

![](/files/-MLABSH5_UwvqNK0hMgE)

{% file src="/files/-MLAF87MfxBuzSO-Yjwz" %}
Example Workbook: VALUEATRISK
{% endfile %}


---

# Agent Instructions: 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://excelhelp.windhamlabs.com/functions/exposure-to-loss/valueatrisk.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.
