Excel EXPAND Function
Chala mitrano — today we learn EXPAND. Read Why → What → How, then try the practice list.
चला मित्रांनो — आज EXPAND शिकू. Why → What → How वाचा, मग practice करा.
चलो दोस्तों — आज EXPAND सीखते हैं। Why → What → How पढ़ो, फिर practice करो।
Purpose
Pad an array to a larger number of rows and columns, filling extra cells with a value.
Return value
A larger array with original values in the top-left and pad values elsewhere.
Syntax
Arguments
| Argument | Required? | Description |
|---|---|---|
array | Required | Starting array. |
rows | Required | Target row count (≥ current rows). |
columns | Optional | Target column count. |
pad_with | Optional | Value for new cells (blank if omitted — behaviour per docs). |
Version
Microsoft 365.
How to use — Why → What → How
Why: Reports sometimes need a fixed-size block for print layouts or downstream formulas.
What: EXPAND grows the spill to the size you ask for.
How — numbered steps:
- Start with =EXPAND(A1:B2, 5, 4, 0).
- Use pad_with="" for blanks.
- Do not shrink with EXPAND — use TAKE/DROP for cutting.
- Combine with HSTACK/VSTACK when building layouts.
- Watch #NUM! if target is smaller than source.
Ravindra Bagale's Tip
EXPAND grows; TAKE/DROP cuts. Remember the pair.
Ravindra Bagale's Tip – मराठी
EXPAND वाढवते; TAKE/DROP कापते.
Ravindra Bagale's Tip – हिंदी
EXPAND बढ़ाता है; TAKE/DROP काटते हैं।
Ravindra Bagale's Tip
Pad wisely — zeros vs blanks change SUM results.
Ravindra Bagale's Tip – मराठी
Pad काळजीपूर्वक — 0 आणि रिकामे SUM बदलतात.
Ravindra Bagale's Tip – हिंदी
Pad सोच-समझकर — 0 और खाली SUM बदलते हैं।
Worked examples
1) Pad with zeros
2×2 block to 4×4.
Result: 4×4 with 0 padding
What it means: Top-left keeps source.
2) Pad with blank text
Labels area.
Result: Length 10 column
What it means: Empty strings below.
3) Prepare chart range
Fixed 12-month slots.
Result: 12 rows
What it means: Missing months as 0.
4) With HSTACK
Layout toy.
Result: Taller stacked block
What it means: Compose arrays.
5) Error when shrinking
Ask for fewer rows.
Result: #NUM! (typical)
What it means: Cannot shrink via EXPAND.
Common errors
Practice tasks (10+)
- Task 1. Expand a 3×2 block to 6×4 with 0.Hint: try on a tiny range first
- Task 2. Expand with "" padding.Hint: try on a tiny range first
- Task 3. Show #NUM! by shrinking.Hint: try on a tiny range first
- Task 4. Expand monthly data to 12 rows.Hint: try on a tiny range first
- Task 5. Explain pad 0 vs blank for SUM.Hint: try on a tiny range first
- Task 6. Combine EXPAND + HSTACK.Hint: try on a tiny range first
- Task 7. Interview: EXPAND vs TAKE.Hint: try on a tiny range first
- Task 8. Fix #SPILL!.Hint: try on a tiny range first
- Task 9. Use LET for target sizes.Hint: try on a tiny range first
- Task 10. Bonus: EXPAND of a UNIQUE list to a fixed length.Hint: try on a tiny range first
Quick quiz
Answers: Q1=True, Q2=False, Q3=True, Q4=True
Related: LAMBDA · LET · GROUPBY · Function hub · Learning path