lrobbo314
Well-known Member
- Joined
- Jul 14, 2008
- Messages
- 3,929
- Office Version
- 365
- Platform
- Windows
SPELLNUMBER takes a number and converts it to spelled out words. There are a number of helper Lambdas which are also listed.
SPELLNUMBER
SML
TENS
HUGE
HOR
ZPAD
TEXTREVERSE
HYPHENATE
SPELLNUMBER
Excel Formula:
=LAMBDA(range,
MAP(range,
LAMBDA(n,
LET(
buckets,SPLITNUM(ZPAD(n)),
r,ROWS(buckets),
t,MAP(buckets,LAMBDA(b,HUNDRED(ARRAYFROMTEXT(b)))),
z,INDEX(HUGE(),SEQUENCE(r,,r,-1)),
TEXTJOIN(" ",,t&" "&z)
)
)
)
)
SML
Excel Formula:
=LAMBDA(LET(sml,{"";"one";"two";"three";"four";"five";"six";"seven";"eight";"nine";"ten";"eleven";"twelve";"thirteen";"fourteen";"fifteen";"sixteen";"seventeen";"eighteen";"nineteen"},sml))
TENS
Excel Formula:
=LAMBDA(LET(tens,{"";"twenty";"thirty";"forty";"fifty";"sixty";"seventy";"eighty";"ninety"},tens))
HUGE
Excel Formula:
=LAMBDA(LET(huge,{"";"thousand";"million";"billion";"trillion";"quadrillion";"quintillion";"sextillion";"septillion";"octillion";"nonillion";"decillion"},huge))
HOR
Excel Formula:
=LAMBDA(input,IF(input="0","",INDEX(SML(),input+1) & " hundred"))
ZPAD
Excel Formula:
=LAMBDA(text,REPT("0",MOD(3-MOD(LEN(text),3),3))&text)
TEXTREVERSE
Excel Formula:
=LAMBDA(text,LET(cnt,LEN(text),TEXTJOIN(,,MID(text,SEQUENCE(cnt,,cnt,-1),1))))
HYPHENATE
Excel Formula:
=LAMBDA(text,chunk_size,
MAP(text,
LAMBDA(t,
TEXTJOIN("-",,MID(t,SEQUENCE(ROUNDUP(LEN(t)/chunk_size,0),,,chunk_size),chunk_size))
)
)
)
Spell Numbers | ||||
---|---|---|---|---|
A | B | |||
1 | Number | Spell | ||
2 | 4 | four | ||
3 | 12 | twelve | ||
4 | 314 | three hundred fourteen | ||
5 | 2,145 | two thousand one hundred forty five | ||
6 | 78,542 | seventy eight thousand five hundred forty two | ||
7 | 652,145 | six hundred fifty two thousand one hundred forty five | ||
8 | 4,521,456 | four million five hundred twenty one thousand four hundred fifty six | ||
9 | 85,452,145 | eighty five million four hundred fifty two thousand one hundred forty five | ||
10 | 362,514,789 | three hundred sixty two million five hundred fourteen thousand seven hundred eighty nine | ||
Sheet6 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B2:B10 | B2 | =SPELLNUMBER(A2:A10) |
Dynamic array formulas. |
Upvote
0