# Selective Cell by Cell Compare

This pre-built Action, 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 then stored in the specified dynamic variable.

{% hint style="warning" %}
**Note:** *it can compare pair of Excel files OR CSV files OR an Excel and a CSV file.*
{% endhint %}

**Input Value:** `<CSV/Excel file path1>;<Sheet name (optional)>;<Cell selection>;<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><em><strong>Note:</strong> This is ignored for CSV files.</em></p>                                       |
| <p>\<Cell selection><br>(Required)</p>          | <p>Specific cell address <br><em>(for example, if the cell is in B column and on 2nd row then cell selection will be B2)</em></p>                                              |
| <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><em><strong>Note:</strong> This is ignored for CSV files.</em></p>                                      |
| <p>\<Cell selection><br>(Required)</p>          | <p>Specific cell address <br><em>(for example, if the cell is in B column and on 2nd row then cell selection will be B2)</em></p>                                              |
| <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:**

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

**Example 1**

**Compare selected cells between Excel and CSV files**

The **Selective Cell by Cell Compare** action compares specified cell ranges between an Excel file and a CSV file (e.g., **C:\Files\Report.xlsx;Sheet1;B5;C:\Files\Report.csv;;B5;IgnoreCase**). This allows focused validation on selected data only, with an optional **IgnoreCase** flag to ignore case differences. The result of the comparison is stored in the **{Comparison Result}** variable, with the following possible values:

* **True** –  if the comparison is completed successfully
* **False** – if the comparison is not completed.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FWsfoYRvGgA3kQ5ZgCsv8%2Fimage.png?alt=media&#x26;token=4dc5e3b1-eb45-453d-b34b-275184afec48" alt=""><figcaption></figcaption></figure>

**Example 2**

#### Compare selected cells between two Excel files

The **Selective Cell by Cell Compare** action compares specified cells between two Excel files and sheets (e.g., **C:\Files\Old.xlsx;Data1;A2;C:\Files\New\.xlsx;Data2;A2**). This is useful for verifying changes or consistency within specific sections of large datasets. The result of the comparison is stored in the **{Comparison Result}** variable, with the following possible values:

* **True** –  if the comparison is completed successfully
* **False** – if the comparison is not completed.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FAsTGsFtfiafRPWzGtK8K%2Fimage.png?alt=media&#x26;token=ef97e794-3f14-4a23-954c-9fa5e91d4eec" alt=""><figcaption></figcaption></figure>

**Example 3**

#### Compare selected cells between two CSV files

The **Selective Cell by Cell Compare** action compares specified cell ranges in two CSV files (e.g., **C:\Files\Jan.csv;A1;D4;C:\Files\Feb.csv;A1;B2**). This allows direct comparison of specific data segments. The result of the comparison is stored in the **{Comparison Result}** variable, with the following possible values:

* **True** –  if the comparison is completed successfully
* **False** – if the comparison is not completed.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FWzNU63QUDTmNyTuBl4wH%2Fimage.png?alt=media&#x26;token=c5b5819e-5d5a-4c16-bfc7-6296dac36dba" alt=""><figcaption></figcaption></figure>
