Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to keep leading zero and add comma in openoffice calc formula?

I have 6 fields in a row in open office, the 1st is a word, the 2nd, 3rd, and 4th are a number with a leading zero, the 5th and 6th are regular numbers. How do I join them all together with a comma between them so that the leading zero stays?

like image 665
user1367204 Avatar asked May 31 '12 15:05

user1367204


1 Answers

Based on your comment about your numbers having a leading 0 in virtue of a custom number format, you need to incorporate TEXT() functions into your formula to retain (i.e., add) your leading 0s.

=CONCATENATE(A1,",",TEXT(B1,"0#####"),",",TEXT(C1,"0#####"),",",TEXT(D1,"0#####"),",",E1,",",F1)

Just be sure to include as many #'s as the max length of a number in that field.

like image 97
Excellll Avatar answered Oct 07 '22 19:10

Excellll