[Solved] How to format a text entry
-
- Posts: 4
- Joined: Tue Jan 01, 2008 11:16 pm
[Solved] How to format a text entry
I am not even sure if this is possible to do with text, but what I would like to do is type in something like QH10S in a cell and have it formatted as Qh 10s. Is this possible? I want to to make the letters C,D,H, and S small case and then add a space afterwards. If anyone knows how this can be done it would be much appreciated. Thanks!
Last edited by purplekegler on Sat Jan 05, 2008 9:22 pm, edited 1 time in total.
Re: How to format a text entry
There's no way to do it as you enter the data--without some macro code anyway--but you can easily change them in bulk after you enter the data. You could also enter the data in one cell, but have a formula in another cell that displays the entry with the desired adjustments.
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 4
- Joined: Tue Jan 01, 2008 11:16 pm
Re: How to format a text entry
OK, that is kind of what I thought. I was hoping that there would be a way of formating it in the way that number entry works. For example, if you have a cell formatted to have two digits after the decimal and type in 25, once you leave that cell it becomes 25.00. That said, you mentioned two things... macro code, and formula in a different cell... could you elaborate please? Thanks!There's no way to do it as you enter the data--without some macro code anyway--but you can easily change them in bulk after you enter the data. You could also enter the data in one cell, but have a formula in another cell that displays the entry with the desired adjustments.
Re: How to format a text entry
Just nitpicking: You want to convert a text value to another text value. This has nothing to do with formatting.
qh10s, QH10S => Qh 10s (first letter upper case, second lower case, space at position #3, rest lower case)
Having the value in A1:
should do the trick. See help on text functions PROPER, UPPER, LOWER, LEFT, RIGHT, MID, LEN, MID,...
qh10s, QH10S => Qh 10s (first letter upper case, second lower case, space at position #3, rest lower case)
Having the value in A1:
Code: Select all
=PROPER(LEFT($A1;2))&" "&LOWER(RIGHT($A1;LEN($A1)-2))
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: How to format a text entry
A program called CSVed will enable this readily on whole columns after the fact, but it will require a few logical steps, and changes will be permanent [unless changed back similarly, or saved as another filename.] Perhaps not worth it unless the number of row entries is large.
David.
David.
-
- Posts: 4
- Joined: Tue Jan 01, 2008 11:16 pm
Re: How to format a text entry
Thanks for pointing me in the right direction. Here is the following function I came up with:Villeroy wrote:Just nitpicking: You want to convert a text value to another text value. This has nothing to do with formatting.
qh10s, QH10S => Qh 10s (first letter upper case, second lower case, space at position #3, rest lower case)
Having the value in A1:should do the trick. See help on text functions PROPER, UPPER, LOWER, LEFT, RIGHT, MID, LEN, MID,...Code: Select all
=PROPER(LEFT($A1;2))&" "&LOWER(RIGHT($A1;LEN($A1)-2))
(I added the UPPER function so that it would work regardless of how it is entered)=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(UPPER(“QH10S”);”S”;”s “);”H”;”h “);”D”;”d “);”C”;”c “)
Now all I need to figure out is how to replace the "QH10S" with the contents of a cell. I'd really like to have the data in the current cell converted. Any ideas?
Re: How to format a text entry
Having the values in A1:A999, put your formula into any free cell, replace literal “QH10S”with unquoted reference A1, copy down the formula cell (copy/paste or drag the tiny square at bottom-right cell corner) until it convers all values in A1:A999. Then copy the resulting range of cells, select the first target cell (A1) and paste special (Ctrl+Shift+V) text values only without formulas.purplekegler wrote:Now all I need to figure out is how to replace the "QH10S" with the contents of a cell. I'd really like to have the data in the current cell converted. Any ideas?
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
-
- Posts: 4
- Joined: Tue Jan 01, 2008 11:16 pm
Re: How to format a text entry
Thank you again!Villeroy wrote:Having the values in A1:A999, put your formula into any free cell, replace literal “QH10S”with unquoted reference A1, copy down the formula cell (copy/paste or drag the tiny square at bottom-right cell corner) until it convers all values in A1:A999. Then copy the resulting range of cells, select the first target cell (A1) and paste special (Ctrl+Shift+V) text values only without formulas.purplekegler wrote:Now all I need to figure out is how to replace the "QH10S" with the contents of a cell. I'd really like to have the data in the current cell converted. Any ideas?
What I did was to create a Sheet 2 identical to Sheet 1. I will enter my data on Sheet 2 and get the desired results on Sheet 1 by using the following function:
I tried it and it works flawlessly! Thanks!=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(UPPER(Sheet2.A2);"S";"s ");"H";"h ");"D";"d ");"C";"c ")