use*_*617 1 excel excel-formula
in excel I need to get this to be a subscript in the output.
Basically I want all the numbers in the output to be subscripted
I have tried this code, and it is part of a large IF "loop"
B2=2
=(B2="","","C"&B2) = C2
Run Code Online (Sandbox Code Playgroud)
where I desire an output like this C_2 (any help to get an actual C subscript her in the question box and not C_2, when making the question, would also be helpful)
the formatting did not work because this is a generic and changing out put where these change with other elements giving different output like
C2O2H, C6H6, C4ON ,C4H6N4 C5H8S2 Etc.
and you can only manually format output once done making the combination, then the next time you need to start over, instead of formatting I need a formula that does this for me, or VBA.
Please help!
Excel 公式改进(编辑)
\n=LET(d,A1,\n ds,MID(d,SEQUENCE(LEN(d)),1),\nTEXTJOIN("",,IFERROR(UNICHAR(832&ds),ds)))\nRun Code Online (Sandbox Code Playgroud)\nLAMBDA函数将是这样的:=LAMBDA(Compound,\n LET(ds,MID(Compound,SEQUENCE(LEN(Compound)),1),\nTEXTJOIN("",,IFERROR(UNICHAR(832&ds),ds))))\nRun Code Online (Sandbox Code Playgroud)\n请参阅后续内容如何使用它。
\nExcel 公式(函数)
\n=LET(d,A1,\n ds,MID(d,SEQUENCE(LEN(d)),1),\n s,MOD(SEQUENCE(10),10),\nTEXTJOIN("",,IF(ISNUMBER(MATCH(--ds,s,0)),UNICHAR(832&ds),ds)))\nRun Code Online (Sandbox Code Playgroud)\nLAMBDA函数:=LAMBDA(Compound,LET(\n ds,MID(Compound,SEQUENCE(LEN(Compound)),1),\n s,MOD(SEQUENCE(10),10),\nTEXTJOIN("",,IF(ISNUMBER(MATCH(--ds,s,0)),UNICHAR(832&ds),ds))))\nRun Code Online (Sandbox Code Playgroud)\n使用 时Ribbon->Formulas->Defined Names->Define Name,您需要想出一个名称(例如Chem,,...)并将其输入到框中,然后Compound将公式输入到框中。现在您可以使用该功能,例如简单地使用SubCompName:Refers to:
=Chem(A1)\n=Chem("H2SO4")\nRun Code Online (Sandbox Code Playgroud)\n请注意,您可以在整个工作簿中使用该函数。
\n编程语言
\n=LET(d,A1,\n ds,MID(d,SEQUENCE(LEN(d)),1),\nTEXTJOIN("",,IFERROR(UNICHAR(832&ds),ds)))\nRun Code Online (Sandbox Code Playgroud)\n