# Spreadsheet Analysis Case — Report

## Scope

Synthetic dataset: `input.csv` (12 order rows). This report describes only the
arithmetic results computed from that file by `calculations.py`. It makes no
causal, forecasting, or business-performance claims.

## Method

Each row in `input.csv` has `order_id`, `channel`, `amount`, and `status`.
Refunded rows (`status == "refunded"`) are **excluded** from all paid revenue
figures and reported separately as refunded order value.

Exact formulas used:

- `paid_revenue = SUM(amount WHERE status == "paid")`
- `refunded_order_value = SUM(amount WHERE status == "refunded")`
- `paid_order_count = COUNT(rows WHERE status == "paid")`
- `paid_order_average = paid_revenue / paid_order_count`
- `channel_paid_revenue[c] = SUM(amount WHERE status == "paid" AND channel == c)`
- `channel_paid_orders[c] = COUNT(rows WHERE status == "paid" AND channel == c)`
- `channel_share[c] = channel_paid_revenue[c] / paid_revenue`

A reconciliation check verifies `paid_revenue + refunded_order_value` equals the
sum of the raw `amount` column.

## Results

| Metric | Value |
| --- | ---: |
| Total rows | 12 |
| Paid orders | 10 |
| Refunded orders | 2 |
| **Paid revenue** | **955** |
| Refunded order value | 115 |
| **Paid-order average** | **95.5** |
| Raw amount column total | 1070 |

### Revenue by channel (paid rows only)

| Channel | Paid revenue | Paid orders | Share of paid revenue |
| --- | ---: | ---: | ---: |
| Email | 240 | 3 | 25.13% |
| Organic | 510 | 4 | 53.40% |
| Social | 205 | 3 | 21.47% |
| **Total** | **955** | **10** | **100.00%** |

## Reconciliation

- Paid revenue (955) + refunded order value (115) = raw total (1070). ✓
- Channel paid revenue (240 + 510 + 205) = paid revenue (955). ✓

Refunded rows excluded from paid figures: A005 (Email, 40) and A009 (Social, 75).

## Reproduce

```
python3 calculations.py
```

Computations are performed programmatically (Python standard library) rather
than by mental arithmetic.
