Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
"Bob Phillips" wrote...
seehttp://www.xldynamic.com/source/xld.xlFAQ0004.html .... I'd use Laurent Longre's MOREFUNC.XLL add-in's NBTEXT function for this. As for a purely worksheet approach, 18 defined names seems a bit much. With the defined names _ones =" one two three four five six seven eight nine " _teens ="ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen " _tens =" twenty thirty forty fifty sixty seventy eighty ninety " _s =ROW(INDEX(Sheet1!$1:$65536,1,1):INDEX(Sheet1!$1:$ 65536,1000,1))-1 _0..999 =SUBSTITUTE(TRIM(IF(_s=100,MID(_ones,10*INT(_s/100)+1,10) &" hundred ","")&IF(MOD(_s,100)=20,MID(_tens, 10*INT(MOD(_s,100)/10)+1,10)&MID(_ones,10*MOD(_s,10)+1,10), MID(IF(INT(MOD(_s,100)/10)=1,_teens,_ones),10*MOD(_s,10)+1,10))), "ty ","ty-") 5 defined names. I could use a formula like the following to represent any number up to 999,999,999,999.99. =IF(INT((N-10^12*INT(N/10^12))/10^9),INDEX(_0..999, 1+(N-10^12*INT(N/10^12))/10^9)&" billion ","") &IF(INT((N-10^9*INT(N/10^9))/10^6),INDEX(_0..999, 1+(N-10^9*INT(N/10^9))/10^6)&" million ","") &IF(INT((N-10^6*INT(N/10^6))/1000),INDEX(_0..999, 1+(N-10^6*INT(N/10^6))/1000)&" thousand ","") &IF(INT(N-1000*INT(N/1000)),INDEX(_0..999, 1+N-1000*INT(N/1000)),"")&" and "&IF(ROUND(100*(N-INT(N)),2), INDEX(_0..999,1+ROUND(100*(N-INT(N)),2)),"no")&" cents" Note: this includes proper English hyphenation of numbers from 21 to 99 that aren't multiples of 10. For proper English capitalization, =SUBSTITUTE(PROPER(SUBSTITUTE(IF(INT((N-10^12*INT(N/10^12))/10^9), INDEX(_0..999,1+(N-10^12*INT(N/10^12))/10^9)&" billion ","") &IF(INT((N-10^9*INT(N/10^9))/10^6),INDEX(_0..999, 1+(N-10^9*INT(N/10^9))/10^6)&" million ","") &IF(INT((N-10^6*INT(N/10^6))/1000),INDEX(_0..999, 1+(N-10^6*INT(N/10^6))/1000)&" thousand ","") &IF(INT(N-1000*INT(N/1000)),INDEX(_0..999, 1+N-1000*INT(N/1000)),"")&" and "&IF(ROUND(100*(N-INT(N)),2), INDEX(_0..999,1+ROUND(100*(N-INT(N)),2)),"no")&" cents","-","q")), "q","-") With 6 more defined names, so just 11 in total, defined with B13 as the active cell, _b =IF(INT((!A17-10^12*INT(!A17/10^12))/10^9), INDEX(_0..999,1+(!A17-10^12*INT(!A17/10^12))/10^9)&" billion ","") _m =IF(INT((!A17-10^9*INT(!A17/10^9))/10^6), INDEX(_0..999,1+(!A17-10^9*INT(!A17/10^9))/10^6)&" million ","") _t =IF(INT((!A17-10^6*INT(!A17/10^6))/1000), INDEX(_0..999,1+(!A17-10^6*INT(!A17/10^6))/1000)&" thousand ","") _o =IF(INT(!A17-1000*INT(!A17/1000)), INDEX(_0..999,1+!A17-1000*INT(!A17/1000)),"") _n2t =SUBSTITUTE(PROPER(SUBSTITUTE(_b&_m&_t&_o&_f,"-","q")),"q","-") I could use formulas like =_n2t to convert the number one column to the left into text form. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Word (text) with a numeric value...PLEASE HELP! | Excel Discussion (Misc queries) | |||
convert numeric to word | Excel Discussion (Misc queries) | |||
Numeric in Text to convert back to the form of Numeric for VLookup Purposes | Excel Discussion (Misc queries) | |||
Match Single Numeric Criteria and Return Multiple Numeric Labels | Excel Worksheet Functions | |||
Print labels by using Excel data in a Word mail into word | Excel Discussion (Misc queries) |