Excel Lab
  • Excel Lab
  • Release Notes
  • Getting Started
    • Installing Excel Lab
      • Step 1: Download Files
      • Step 2: Register Libraries
      • Step 3: Activate Add-in
      • Step 4: Verify Installation
  • Functions
    • General
      • ISMATRIXPSD
      • MATRIX
      • XLABHELP
      • XLABINFO
      • XLABLICENSE
      • RESETPASSWORD
    • Return Models
      • CAPM
      • DESMOOTHRETURNS
      • IMPLIEDRETURNS
      • MLERETURNS
    • Risk Models
      • ANNUALIZERISK
      • EWMA
      • HISTORICALRISK
      • MLERISK
      • PORTFOLIORISK
      • TURBULENTRISK
      • QUIETRISK
    • Optimization
      • MVO
      • MTO
      • MVT
      • MVFRONTIER
      • MTFRONTIER
      • ISORETURN
    • Simulation
      • MCNORM
      • BOOTSTRAP
    • Exposure to Loss
      • LOSSPR
      • OMEGARATIO
      • SORTINORATIO
      • TAILRATIO
      • VALUEATRISK
      • MAXDD
    • Regression Analysis
      • FACTORANALYSIS
      • PSR
    • Scenario Analysis
      • MAHALANOBIS
      • SCENARIOPR
      • IMPLIEDSCENARIO
  • Frequently Asked Questions
    • Common Issues
    • FAQ
  • Further Reading
  • Windham's Research Insights
  • Watch Our Educational Videos
Powered by GitBook
On this page
  • Description
  • Syntax
  • Example
  1. Functions
  2. General

MATRIX

Concatenate disjointed arrays in Excel column (or row)-wise into a matrix

PreviousISMATRIXPSDNextXLABHELP

Last updated 4 years ago

Description

Microsoft Excel does not provide a natural way to work with concatenating numerical arrays / vectors. The only natural way to do this in Microsoft Excel is to input or display vectors adjacent to another within a worksheet.

This restriction can force copying and replicating vectors into new or existing sheets when constructing more complex workbooks that require references to matrix's constituents in different columns (or rows).

The MATRIX function in Excel Lab allows you to concatenate arrays intuitively and can be used nested within other Microsoft Excel or Excel Lab functions.

Syntax

output = MATRIX(v1, v2, ...., vN, isRow)

Argument

Description

v1,v2,...,vN

Column-vectors, row-vectors, or matrices.

isRow

Optional. Logical flag (TRUE or FALSE) to indicated whether you would like to concatenate the input vectors/matrices row-wise. Defaults to false (column-wise concatenation).

Input vectors (or matrices) are concatenated column-wise by default or when isRow is FALSE.

output=[v1v2…vN]\text{output}= \begin{bmatrix}v_1 & v_2 & \dots & v_N \end{bmatrix}output=[v1​​v2​​…​vN​​]

When isRow is specified and set to FALSE, the function concatenates the input vectors (matrices) row-wise

output=[v1v2⋮vN]\text{output}= \begin{bmatrix}v_1 \\ v_2 \\ \vdots \\ v_N \end{bmatrix}output=​v1​v2​⋮vN​​​

Example