Text Functions
Beginner

Build a plain-text urgency bar and price each line for an emailed restock report

REPT repeats a character exactly as many times as you tell it to, and DOLLAR turns a plain number into the currency text a chart-free email actually needs — neither one reads what the other produces.

Task:

You handle inventory for a hardware store, and mornings start with an automated reorder email that goes out as plain text — no images, no embedded charts, just characters a mail client can render. Four products need restocking today. In column D, build a quick urgency bar for each one using REPT, one "■" character per unit needed, so a reader can see which products are furthest behind at a glance. In column E, show what restocking each product will cost — units needed times unit cost — formatted as currency text with DOLLAR, rounded to two decimal places, ready to paste straight into that email.

Learning Objectives:

  • Use REPT to turn a plain count into a repeated-character bar for a plain-text report
  • Use DOLLAR to format a calculated number as currency text, not just a rounded number
  • Recognize when two formulas in the same row are answering different questions rather than feeding into each other
Hints

Solve without hints for +5 XP

Interactive Spreadsheet

The data in this exercise

This is the grid you start with. Cell references in the task — B6, C2 — point at the row numbers and column letters below.

ABCDE
1ProductUnits NeededUnit CostReorder BarReorder Cost
2Widget A312.5
3Widget B64.25
4Widget C245
5Widget D58.75
What this exercise teaches (contains the answer)

REPT("■",B2) doesn't know anything about inventory — it just repeats whatever character it's given exactly as many times as its second argument says, so Widget A's 3 units needed becomes three squares and Widget B's 6 becomes six, giving a reader something to compare at a glance without an actual chart. DOLLAR(B2*C2,2) is answering a completely different question: B2*C2 works out the plain number 37.5 for Widget A, and DOLLAR turns that number into the text "$37.50" — the dollar sign and the trailing zero a plain number quietly drops both appear because DOLLAR is formatting for a reader, not just rounding for a spreadsheet. Neither function reads what the other one produced; REPT's bar in column D and DOLLAR's price in column E just sit side by side, describing the same row from two different angles, one visual and one exact.