Another number format

In Microsoft Excel, there are a large number of possible number formats. One of the formats that I find under the “special” formats is “telephone number.” I can type in 10 digits and it instantly formats them as a telephone number, i.e. (123) 456-7890. I find this function very useful and time-saving. Is there any similar function in LibreOffice Calc?

Thanks! This is great!

I did find the format in Excel - it is English US only. Bizarrely, it starts with the premise that a telephone number is a number, it isn’t, it is Text.
If the telephone number is entered as Text in A2, then in B2 you could add formula
=IF(LEN(A2)>10;"("&LEFT(A2;LEN(A2)-7)&") "&MID(A2;LEN(A2)-6,3)&"-"&MID(A2;LEN(A2)-3;4);"("&LEFT(A2;3)&") "&MID(A2;4;3)&"-"&MID(A2;7;4))

That should display US phone numbers as Excel but also international ones such as (+41xxx) xxx-xxxx

I find it useful in Excel because I have to enter clients’ phone numbers and all I have to do is put in the 10 digits, then Excel formats them for me. It’s very quick and easy. I was hoping I could find a similar function in Calc, and it looks like I can do it with a custom function. (I’m only entering U.S. phone numbers in this case.)

You can easily create a suitable format yourself

1 Like

Be aware that leading 0 digits are lost and display is odd with less than 8 digits.