# Selective Cell by Cell Compare

This pre-built action is available under the **@Generic** element, enables Avo Assure to perform a file comparison by selectively checking cells one by one based on the input value. The comparison result is stored in the specified dynamic variable.

{% hint style="info" %}
**Note:** It compares pair of Excel files OR CSV files OR an Excel and a CSV fil&#x65;*.*
{% endhint %}

**Input Value:** `<CSV/Excel file path1>;<Sheet name (optional)>;<Range>;<CSV/Excel file path2>;<Sheet name (optional)>;<Cell selection>;<IgnoreCase (optional)>`

| Argument                                        | Description                                                                                                                                                                    |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p>\<CSV/Excel file path1></p><p>(Required)</p> | Provide the path to the first file (source or reference), which can be in .csv, .xls, or .xlsx format.                                                                         |
| <p>\<Sheet name><br>(Optional)</p>              | <p>Specify the sheet name of the first Excel file (if applicable).<br><strong>Note:</strong> This is ignored for CSV files.</p>                                                |
| <p>\<Range><br>(Required)</p>                   | Specific range of the cells to compare with second file separated by semi colons (:).                                                                                          |
| <p>\<csv/Excel file path2><br>(Optional)</p>    | Provide the path to the second file (target/actual file to compare), which can be in .csv, .xls, or .xlsx format.                                                              |
| <p>\<Sheet name><br>(Optional)</p>              | <p>Specify the sheet name of the second Excel file (if applicable).<br><strong>Note:</strong> This is ignored for CSV files.</p>                                               |
| <p>\<Range><br>(Required)</p>                   | Specific range of the cells to compare with second file separated by semi colons (:).                                                                                          |
| <p>\<IgnoreCase> <br>(optional)</p>             | <p>Optional parameter to perform case-insensitive comparison.<br>1. Use the value ignoreCase (case-insensitive )<br>2. If not specified, the comparison is case-sensitive.</p> |

**Output Value**: `<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)`

| Argument                                                    | Description                                              |
| ----------------------------------------------------------- | -------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | This variable stores the status as **True** or **False** |

### **Example 1:** Comparing Selected Cells Between Excel and CSV Files

In this example, we show how to compare selected cell ranges between an Excel file and a CSV file.

* **Action:** Selective Cell by Cell Compare
* **Input Value:** C:\Excel & CSV\excel\_file.xlsx;Test\_2;A2:A5;C:\Excel & CSV\csv\_file.csv;csv\_file;A2:A5;IgnoreCase
  * The first part (**C:\Excel & CSV\excel\_file.xlsx**) specifies the Excel file path.
  * The second part (**Test\_2**) specifies the Excel sheet name.
  * The third part (**A2:A5**) specifies the cell range in the Excel file to compare.
  * The fourth part (**C:\Excel & CSV\csv\_file.csv**) specifies the CSV file path.
  * The fifth part (**csv\_file**) specifies the CSV file name.
  * The sixth part (**A2:A5**) specifies the cell range in the CSV file to compare.
  * The seventh part (**IgnoreCase**) specifies that case differences are ignored during comparison.
* **Output Value:** {Comparison Result}

  The comparison result is stored in this dynamic variable with the following possible values:

  * **True:** If the comparison is completed successfully.
  * **False:** If the comparison is not completed.
* **Logical Explanation:**

The **Selective Cell by Cell Compare** action fetches the values from the **Input Value** column and compares the specified cell ranges (**A2:A5**) between the Excel file and CSV file. The **IgnoreCase** option ignores case differences during comparison. The result of the comparison is stored in the **{Comparison Result}** variable as **True** if the comparison is completed successfully or **False** if the comparison is not completed.

<figure><img src="/files/ZPUXUHH17gnzyPiSqD9P" alt=""><figcaption></figcaption></figure>

### Example 2: Comparing Selected Cells Between Two Excel Files

In this example, we show how to compare specified cell ranges between two Excel files and sheets.

* **Action:** Selective Cell by Cell Compare
* **Input Value:** C:\Excel & CSV\excel\_file.xlsx;Test\_1;A3:A5;C:\Excel & CSV\excel\_file.xlsx;Test\_2;A3:A5
  * The first part (**C:\Excel & CSV\excel\_file.xlsx**) specifies the source Excel file path.
  * The second part (**Test\_1**) specifies the source Excel sheet name.
  * The third part (**A3:A5**) specifies the cell range in the source Excel sheet to compare.
  * The fourth part (**C:\Excel & CSV\excel\_file.xlsx**) specifies the destination Excel file path.
  * The fifth part (**Test\_2**) specifies the destination Excel sheet name.
  * The sixth part (**A3:A5**) specifies the cell range in the destination Excel sheet to compare.
* **Output Value:** {Comparison Result}

  The comparison result is stored in this dynamic variable with the following possible values:

  * **True:** If the comparison is completed successfully.
  * **False:** If the comparison is not completed.
* **Logical Explanation:**

The **Selective Cell by Cell Compare** action fetches the values from the **Input Value** column and compares the specified cell ranges (**A3:A5**) between the two Excel sheets **Test\_1** and **Test\_2**. This helps verify whether the selected data matches across both Excel files. The comparison result is stored in the **{Comparison Result}** variable as **True** if the comparison is completed successfully or **False** if the comparison is not completed.

<figure><img src="/files/PuJXPHk8NOXmjMUqdTtJ" alt=""><figcaption></figcaption></figure>

### Example 3: Comparing Selected Cells Between Two CSV Files

In this example, we show how to compare specified cell ranges between two CSV files.

* **Action:** Selective Cell by Cell Compare
* **Input Value:** C:\Excel & CSV\csv\_file.csv;csv\_file;A2:A5;C:\Excel & CSV\csv\_file\_2.csv;csv\_file;A2:A5
  * The first part (**C:\Excel & CSV\csv\_file.csv**) specifies the source CSV file path.&#x20;
  * The second part (**csv\_file**) specifies the source CSV file name.&#x20;
  * The third part (**A2:A5**) specifies the cell range in the source CSV file to compare.&#x20;
  * The fourth part (**C:\Excel & CSV\csv\_file\_2.csv**) specifies the destination CSV file path.&#x20;
  * The fifth part (**csv\_file**) specifies the destination CSV file name.&#x20;
  * The sixth part (**A2:A5**) specifies the cell range in the destination CSV file to compare.
* **Output Value:** {Comparison Result}

  The comparison result is stored in this dynamic variable with the following possible values:

  * **True:** If the comparison is completed successfully.
  * **False:** If the comparison is not completed.
* **Logical Explanation:**

The **Selective Cell by Cell Compare** action fetches the values from the **Input Value** column and compares the specified cell ranges (**A2:A5**) between the two CSV files. This helps validate whether the selected data segments match across both files. The comparison result is stored in the **{Comparison Result}** variable as **True** if the comparison is completed successfully or **False** if the comparison is not completed.

<figure><img src="/files/cu6fl92BoSTJ8JPHJfWT" alt=""><figcaption></figcaption></figure>


---

# 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://docs.avoautomation.com/avo-assure/actions/generic/file-and-folder-operations/selective-cell-by-cell-compare.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.
