### Excel ROW Function

The Excel ROW function returns the row number for a reference. For example, ROW(C5) returns 5, since C5 is the fifth row in the spreadsheet. When no reference is provided, ROW returns the row number of the cell which contains the formula.

```=ROW(A3) // returns 3
=ROW(D5) // returns 5
=ROW(F10:J15) // returns 10```

### Read Excel file in Pandas

`import pandas as pd`
```excel_file = 'movies.xls'
```movies_sheet1 = pd.read_excel(excel_file, sheetname=0, index_col=0)
```

### Extract unique items from a list in Excel

Array distinct formula (requires pressing `Ctrl + Shift + Enter)`:

`{=INDEX(list,MATCH(0,COUNTIF(\$D\$4:D4,list),0))}`
```=IFERROR(INDEX(\$A\$2:\$A\$10, MATCH(0, COUNTIF(\$B\$1:B1, \$A\$2:\$A\$10), 0)), "")
```

### Excel MATCH Function

MATCH is an Excel function used to locate the position of a lookup value in a row, column, or table. MATCH supports approximate and exact matching, and wildcards (* ?) for partial matches. Often, the INDEX function is combined with MATCH to retrieve the value at the position returned by MATCH.

```=MATCH(E2,B3:B11,0)
```
```=MATCH("pq*",B3:B11,0)
```
```=MATCH("peach",B3:B9,0)
```

### Excel INDEX Function

The Excel INDEX function returns the value at a given position in a range or array. You can use index to retrieve individual values or entire rows and columns. INDEX is often used with the MATCH function, where MATCH locates and feeds a position to INDEX.

```=INDEX(A1:B5,2,2) // returns value in B2
=INDEX(A1:B5,3,1) // returns value in A3```

### Excel Array formula

An array formula performs an operation on multiple values instead of a single value. The final result of an array formula can be either one item or an array of items, depending on how the formula is constructed. To work correctly, many array formulas need to be entered with `control + shift + enter`. When you enter a formula this way, you’ll see the formula wrapped in curly braces {} in the formula bar.

```{=SUM(LEN(B2:B11))}
```

### Excel Expanding Reference or Expanding Range

```=SUM(\$C\$4:C4) // D4
=SUM(\$C\$4:C5) // D5
=SUM(\$C\$4:C6) // D6```

### Python Openpyxl right to left sheet

```worksheet.sheet_view.rightToLeft = True
```

### Excel SUMIF function

```SUMIF(range, criteria, [sum_range])
```

range   Required. The range of cells that you want evaluated by criteria. Cells in each range must be numbers or names, arrays, or references that contain numbers. Blank and text values are ignored. The selected range may contain dates in standard Excel format (examples below).

criteria   Required. The criteria in the form of a number, expression, a cell reference, text, or a function that defines which cells will be added.

sum_range   Optional. The actual cells to add, if you want to add cells other than those specified in the range argument. If the sum_range argument is omitted, Excel adds the cells that are specified in the range argument (the same cells to which the criteria is applied).