Convert numbers to letters

quemuenchatocha

Board Regular
Joined
Aug 4, 2021
Messages
50
Office Version
  1. 365
  2. 2019
Platform
  1. 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.

Libro1
ABCD
1
2101Ciento uno
3
4
Example
Cell Formulas
RangeFormula
C2C2=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.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I could not find any part that spells for number <100?
with using CHOOSE like this:
number: B2 = 101, choose(mid(text(B2,"000,00"),1,1),...) = choose(mid("101,00",1,1),...) = choose(1,..)
but with number B2 = 90, choose(mid(text(B2,"000,00"),1,1),...) = choose(mid("090,00",1,1),...) = choose(0,..) => nothing to choose ==> error

I dont know how to spell number under 100 in spanish, but you should add more like this:
=IFB2<100, initial formula combination but with TEXT(B2,"00,00") (2 digit only), initial formula)
 
Upvote 0
Or shorter:
in initial formula, replace TEXT(...) by:
IF(B2<100,text(B2,"00,00"),text(B2,"000,00"))
 
Upvote 0
Thank you very much for your valuable information, indeed I was missing to incorporate in the formula the argument equivalent to the values less than 100, now it works correctly, your help was very useful, very kind for your collaboration.
 
Upvote 0

Forum statistics

Threads
1,224,816
Messages
6,181,141
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top