Subscript based on cell value

I would like to format a cell like dt=600.
That 600 is the content of another cell which might be altered and this alteration should be reflected in the subscript value.

Thomas

It appears that you can change character position with fixed data, but not when referencing another cell. In this case, the text reverts to normal.

You can use Unicode subscript characters (₀₁₂₃₄₅₆₇₈₉).

Paste the following formula into the cell that will display the formatted text (* dₜ₌₆₀₀ *), replacing A1 with the reference to the cell to be altered (by typing 600):

="dₜ₌"&SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1;"0";"₀");"1";"₁");"2";"₂");"3";"₃");"4";"₄");"5";"₅");"6";"₆");"7";"₇");"8";"₈");"9";"₉")

It doesn’t seem an elegant formula to me, but it does the job.

Sample file: Unicode subscripts.ods

Subscript 0’s code is 2080, 1’s is 2081, and so on; 209C for and 208C for . If do you type 2080 and inmediatelly press Alt+X it appear a .

Normal 0’s code is 0030, 1’s is 0031, and so on.

Table of Unicode Superscripts and Subscripts.

Table of Unicode Phonetic Extensions.

Edit your question if you want to add more information; also can comment an answer (Add Answer is reserved for solutions).

Check the mark (Correct answer mark) to the left of the answer that solves your question.

not quite elegant, but at least a solution
Thanks

1 Like

If you are willing to use macros, hear is a more compact (and applicable to any string length) solution:

Replace characters with UNICODE superscripts

MyString=SF_String.ReplaceChar(MyString,“0123456789±”,“⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻”)

I really would like a way to be able to access the Font Effects property of the string directly via a function, but I assume that there is a good reason why it appears not to be supported in either Excel or calc. Substituting as above, assumes that the font used has the UNICODE superscript characters. When using this manually in a spreadsheet, one is instead modifying the Font Effect properties of the regular character. So there is a difference: The character code does not change with the manual approach of adding the superscript effect.

So what I really would like are functions like:
FontEffectSet(InString,FontEffectName,Pos,Count,OnOffVal) [Default values: Count=1, OnOffVal=On]
FontEffectClear(InString,Pos,Count)
FontEffectGet(InString,FontEffectName,Pos)

The FontEffectName would be string in a set like “SuperScript”, “SubScript”, “UnderLine”,…
FontEffectClear would clear ALL font effects in the supplied part of the string
The FontEffectGet function would return the current value of the supplied EffectName of the character at “Pos”