Text
Pad text and amounts into an illustrative fixed-width record
Build a 12-character name and eight-digit cents field, with an explicit amount-overflow guard.
Truncate AND pad simultaneously with LEFT(Text & REPT(...), Width)
This teaching format uses 12 name characters plus eight decimal digits for cents. It is not a banking or EDI specification.
LEFT pads or truncates the name. Validate the amount before using RIGHT, which otherwise silently discards leading digits.
| Payee (A) | Amount (B) | 12-Char Text Field | 8-Digit Cents | 20-Char Record |
|---|---|---|---|---|
| Apex Labs | $142.50 | "APEX LABS " | "00014250" | "APEX LABS 00014250" |
| Northwind Logistics Inc | $9.05 | "NORTHWIND LO" | "00000905" | "NORTHWIND LO00000905" |
Fixed-width builder with amount validation
Multiply dollar amounts by 100 inside ROUND(..., 0) before right-slicing REPT("0", 8) & Cents.
=IF(OR(B2<0,ROUND(B2*100,0)>99999999),"Amount out of range",LEFT(UPPER(TRIM(A2)) & REPT(" ", 12), 12) & RIGHT(REPT("0", 8) & ROUND(B2 * 100, 0), 8))Verify exact 20-character fixed record length
Valid records in this illustrative format have length 20; invalid amounts return a message.
=IF(OR(B2<0,ROUND(B2*100,0)>99999999),"Amount out of range",LEN(LEFT(UPPER(TRIM(A2)) & REPT(" ", 12), 12) & RIGHT(REPT("0", 8) & ROUND(B2 * 100, 0), 8)))Inputs and interpretation
This is an invented 20-character ASCII-style format, not an ACH, NACHA, EDI or bank-compliant record. Confirm actual field widths, encoding and permitted characters with the receiving system. LEN is not encoded byte length. Name truncation is an explicit policy and can lose information. Amounts must be nonnegative and rounded cents must fit eight digits.
Try the example
Use the original values or change them to test your understanding.