# Chapter 2 — From Formulas to Prompts

# ── PROMPT 1: translate Excel logic to English ──────────────────
Explain what this Excel formula does in plain English:
=IF(AND(H2>=2000, I2="Delivered"), H2*0.05, IF(I2="Cancelled", 0, H2*0.02))

# ── PROMPT 2: build a formula from a description ────────────────
I have a sales dataset in Excel.
Column H = total (order value in EUR)
Column I = status (Delivered/Shipped/Pending/Cancelled)
Column C = region (North/South/East/West)

Write an Excel formula for column J that calculates commission:
- North region, Delivered, total >= 2000: 8% of total
- North region, Delivered, total < 2000: 5% of total
- Any other region, Delivered: 6% of total
- Any other status: 0

# ── PROMPT 3: VLOOKUP / XLOOKUP ────────────────────────────────
I have two sheets in Excel:
Sheet1: sales data with column D = product name
Sheet2: a product lookup table with columns A = product name, B = unit_price, C = category

Write a formula for Sheet1 column K that looks up the category from Sheet2
based on the product name in column D. Use XLOOKUP (Excel 365) or VLOOKUP
(older versions). Handle the case where the product is not found.

# ── PROMPT 4: complex nested formula ────────────────────────────
I need a formula that calculates a customer tier based on their total
annual spend (cell B2):
- Platinum: >= €50,000
- Gold: >= €25,000 and < €50,000
- Silver: >= €10,000 and < €25,000
- Bronze: < €10,000

Write this using IFS (Excel 365) and nested IF (older Excel).
Which is more readable?
