quemuenchatocha
Board Regular
- Joined
- Aug 4, 2021
- Messages
- 50
- Office Version
- 365
- 2019
- Platform
- Windows
Dear all, best regards
I am trying to convert numbers to letters (in Spanish) with the help of some formulas, I have used the range of numbers between 1 and 999. The formula I am using seems to work but not quite right, since it gives results for any number greater than 100, but when I use a number less than 100, for example 99, 15, 11, it gives me an error.
Am I missing a line or do I have an error that I have overlooked?
I thank you for your kind and valuable assistance.
I am trying to convert numbers to letters (in Spanish) with the help of some formulas, I have used the range of numbers between 1 and 999. The formula I am using seems to work but not quite right, since it gives results for any number greater than 100, but when I use a number less than 100, for example 99, 15, 11, it gives me an error.
Libro1 | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | ||||||
2 | 101 | Ciento uno | ||||
3 | ||||||
4 | ||||||
Example |
Cell Formulas | ||
---|---|---|
Range | Formula | |
C2 | C2 | =IF(AND(--MID(TEXT(B2,"000,00"),2,1)=0,--MID(TEXT(B2,"000,00"),3,1)=0),CHOOSE(MID(TEXT(B2,"000,00"),1,1),"Cien ","Doscientos ","Trescientos ","Cuatrocientos ","Quinientos ","Seiscientos ","Setecientos ","Ochocientos ","Novecientos "),CHOOSE(MID(TEXT(B2,"000,00"),1,1),"Ciento ","Doscientos ","Trescientos ","Cuatrocientos ","Quinientos ","Seiscientos ","Setecientos ","Ochocientos ","Novecientos ") & IF(--MID(TEXT(B2,"000,00"),3,1)=0,CHOOSE(MID(TEXT(B2,"000,00"),2,1)+1,,,"veinte ","treinta ","cuarenta ","cincuenta ","sesenta ","setenta ","ochenta ","noventa "),CHOOSE(MID(TEXT(B2,"000,00"),2,1)+1,,,"veinti","treinta y ","cuarenta y ","cincuenta y ","sesenta y ","setenta y ","ochenta y ","noventa y ")) &IF(--MID(TEXT(B2,"000,00"),2,1)<>1,CHOOSE(MID(TEXT(B2,"000,00"),3,1)+1,,"uno","dos","tres","cuatro","cinco","seis","siete","ocho","nueve"),CHOOSE(MID(TEXT(B2,"000,00"),3,1)+1,"diez","once","doce","trece","catorce","quince","dieciséis","diecisiete","dieciocho","diecinueve"))) |
Am I missing a line or do I have an error that I have overlooked?
I thank you for your kind and valuable assistance.