# NxVaR - Calculates the Portfolio Value at Risk (VaR)

Returns the historical/theoretical value at risk (VaR).

## Syntax

NxVaR(X ,C, Method, Distribution)
X
is the portfolio rate of returns data series (a one-dimensional array of cells (e.g., rows or columns)).
C
is the statistical confidence level for calculating the VaR. If missing, a confidence value of 95% is assumed.
Method
is an integer switch to select the method for calculating the VaR: (0 = Historical (default), 1 = KDE, 2 = Theoretical).
Value Description
0 Historical (default).
1 Kernel Density Estimation (KDE).
2 Theoretical.
Distribution
is an integer switch to select the underlying theoretical distribution: (0 = Gaussian (default), 1 = Log Normal).
Value Distribution
0 Gaussian Distribution (default).
1 Log-Normal Distribution.

#### Status

The NxVaR function is available starting with NumXL version 1.68 CAMEL.

## Remarks

1. By definition, all values in the input data set (i.e., X) must be greater than -1.0.
2. The input data series may include missing values (e.g., #N/A, #VALUE!, #NUM!, empty cell), but they will not be included in the calculations.
3. Value at Risk (VaR) is a statistic that quantifies the extent of possible financial losses within a firm, portfolio, or position over a specific time frame.
4. There are three main ways of computing VaR.
1. The first is the historical method, which looks at one's prior returns history. In this method, VaR is determined by taking the returns belonging to the lowest quintile of the series (identified by the confidence level).
2. The second is the variance-covariance method. Instead, this method assumes that gains and losses are normally distributed (or logNormal).
3. A final approach to VaR is to conduct a Monte Carlo simulation.
5. The VaR value for the boundary conditions is as follows:
1. For the zero (0) confidence level, the VaR is infinite.
2. For the 100% confidence level, the VaR is -1.0.
6. Despite being widely used, VAR suffers from a few drawbacks:
1. VaR does not indicate the size of the loss associated with the tail of the probability distribution out of the confidence level.
2. VaR is not additive, so VaR figures of components of a portfolio do not add to the VaR of the overall portfolio because this measure does not take correlations into account.
3. VaR calculated with different methods may differ significantly.

## Examples

Example 1:

1
2
3
4
5
6
7
8
9
10
11
12
A B C
Date Fund Index
1/1/2017 #N/A #N/A
2/1/2017 0.030 0.020
3/1/2017 0.020 -0.040
4/1/2017 -0.007 -0.007
5/1/2017 0.055 0.055
6/1/2017 0.028 0.028
7/1/2017 0.002 0.002
8/1/2017 -0.117 -0.10
9/1/2017 0.012 0.02
10/1/2017 0.021 0.021
11/1/2017 0.111 0.05

Formula Description (Result)
=NxVaR(\\$B\\$2:\\$B\\$14,0.95, 0) VaR (historical) (-0.07844)
=NxVaR(\\$B\\$2:\\$B\\$14,0.95, 1) VaR (Normal) (-0.07844)
=NxVaR(\\$B\\$2:\\$B\\$14,0.95, 2) VaR (Log-Normal) (-0.07809)