> ## Documentation Index
> Fetch the complete documentation index at: https://docs.graphy.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# XLSX

Parse XLSX spreadsheet files into the [Data structure](/sdk/core/data-structure) expected by `@graphysdk/core`.

## fromXLSX

```typescript theme={null}
import { fromXLSX } from '@graphysdk/data-import-utils/xlsx';

const buffer = await file.arrayBuffer();
const data = await fromXLSX(buffer);
```

### Signature

```typescript theme={null}
function fromXLSX(
  input: ArrayBuffer,
  options?: SpreadsheetParseOptions
): Promise<Data>
```

## Options

<ParamField path="sheet" type="string | number" default="0">
  Sheet to parse. Pass a sheet name (`string`) or a 0-based index (`number`).
  Defaults to the first sheet.
</ParamField>

<ParamField path="locale" type="VizLocale" default="EN_US">
  Locale for number parsing. Determines thousand/decimal separator conventions.
</ParamField>

<ParamField path="maxFileSize" type="number" default="5">
  Maximum allowed input size in megabytes. Throws an error if the input exceeds this limit.
</ParamField>

<ParamField path="maxRows" type="number" default="100000">
  Maximum number of data rows to process. Throws an error if the sheet contains more rows.
</ParamField>

<ParamField path="maxCells" type="number" default="5000000">
  Maximum total cells (rows x columns) to process. Throws an error if the limit is exceeded.
</ParamField>

## Examples

### Select Sheet by Name

```typescript theme={null}
const data = await fromXLSX(buffer, { sheet: 'Revenue' });
```

### Select Sheet by Index

```typescript theme={null}
const data = await fromXLSX(buffer, { sheet: 2 }); // Third sheet (0-indexed)
```

## Cell Value Handling

| Cell type | Result          |
| --------- | --------------- |
| Number    | `number`        |
| String    | `string`        |
| Boolean   | `1` or `0`      |
| Date      | ISO 8601 string |
| Formula   | Computed result |
| Rich text | Plain text      |
| Empty     | `null`          |
