> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/read-excel-file.md).

# Read excel file

Reading an excel file is the action of extracting the value of a specific data cell in an Excel file (`.xlsx` or `.xls`) based on the specified row and column position, and then storing that value into an output variable.

#### Configuration parameters:

* File Path: The absolute path to the Excel file to read data from on the computer (e.g., `D:\GPM\data.xlsx`).
* Sheet index: The position of the sheet to read in the Excel file, starting from 0 *(The first sheet is `0`, the second sheet is `1`...)*.
* Column Name or Index: The position of the column containing the data to be retrieved. You can specify it in two ways:
  * By letter: `A`, `B`, `C`, `D`...
  * By index number, starting from 1 *(Column A is `1`, Column B is `2`...)*.
* Row Index: The position of the row containing the data to be retrieved, starting from 1 *(The first row is the header row or data row 1 will be `1`, the next row is `2`...)*.
* Output variable: The name of the variable that stores the value read from that Excel cell.

#### Practical example: Reading username and password from an Excel file for login

Suppose you have an Excel file containing a list of accounts located at the path `D:\GPM\accounts.xlsx`. The structure of the first sheet (Sheet index = 0) is as follows:

* Column A (Column 1): Contains Username
* Column B (Column 2): Contains Password

You want to read the account data from row number 2 (the first data row after the header row):

* Configuration to get Username:
  * File Path: `D:\GPM\accounts.xlsx`
  * Sheet index: `0`
  * Column Name or Index: `A` (or enter `1`)
  * Row Index: `2`
  * Output variable: `$username`
* Configuration to get Password: You create another similar action below:
  * The parameters remain the same, only change Column Name or Index to `B` (or enter `2`) and set Output variable to `$password`.

Result: The system will accurately extract the value of cell `A2` into the variable `$username` and cell `B2` into the variable `$password`. You can then pass these two variables into the browser interaction action to perform automatic login.

<figure><img src="/files/5FNm8P3wjd4clex2kxyQ" alt=""><figcaption></figcaption></figure>


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.gpmautomate.com/automate-en/action-guides/file-and-folder/read-excel-file.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
