Superscript Formula in Excel Function CONCATENATE

In summary, the conversation discusses using MS Excel and its CONCATENATE function to organize reactions in a specific format. The participants explore the possibility of combining superscripts and normal font in the same cell, and suggest using multiple columns or VBA as potential solutions. The conversation also mentions a specific code found online that can be modified to work for the desired reaction format.
  • #1
parazit
75
3
Hello Master.

I would like to ask a question about MS Excel and one of it's functions; CONCATENATE.

I'm trying to write a huge number of reactions in the Excel as the following form : 12C (α,p) 15N

So, since I have tons of reactions to organize according to the alphabetic order and isotopes I decided to use excel cells as following. (in parentheses, the values of upper reaction)

A1 : Target isotopes mass number ( 12 )
B1 : Target symol ( C )
C1 : Incoming particle ( α )
D1 : Outgoing particle ( p )
E1 : Product isotopes mass number ( 15 )
F1 : Product symbol ( N )

and used
Code:
=CONCATENATE(A1;B1;"(";C1;",";D1;")";E1;F1)
to write them in the form.

However, this is not true since I need that, cells A1 and E1 have to be written as the superscripts of cells B1 and F1 respectively in the same line.

Are there any way to do that ? I am open to any suggestion either solving this problem or a new, different way to let me write that tones of reactions in a suitable order.

Thank you,
Best.
 
Physics news on Phys.org
  • #2
I'm not even sure if combining superscripts and normal font size in the same cell is possible at all. You could use multiple columns for your formula, the first and third with superscript and the others with normal font.

By the way: instead of CONCATENATE, you can also use the shorter =A1&B1&...
 
  • #3
mfb said:
I'm not even sure if combining superscripts and normal font size in the same cell is possible at all. You could use multiple columns for your formula, the first and third with superscript and the others with normal font.

By the way: instead of CONCATENATE, you can also use the shorter =A1&B1&...

Thanks for the advise about the shorter way. I'm aware of that but I think if I use concatenate, I'll be able to make superscripts more easily, which I won't be able.

About multiple cells idea; it seems it's not going to work since in that way, the reaction equation will be parted and I won't be able to order all the reactions. (or am I wrong? I really do not know)
 
  • #5
pasmith said:
It can be done using VBA (in Excel 2003 at least).

Dear pasmith, thank you so much. It gives me an inspiration. I also found that on the web.

Yes, it was done before using VBA but not exactly in the way that I need and suitable for reaction indication.

The code that I found is like that :
Code:
Sub test()
Range("C1").ClearContents
Range("C1").Value = Range("A1").Value & Range("B1").Value
For i = 1 To Len(Range("A1").Value)
    If Range("A1").Characters(i, 1).Font.Bold = True Then Range("C1").Characters(i, 1).Font.Superscript = True
Next i
For j = 1 To Len(Range("B1").Value)
If Range("B1").Characters(j, 1).Font.Superscript = True Then Range("C1").Characters(j + Len(Range("A1").Value), 1).Font.Superscript = True
Next j
End Sub

in where the value of cell A2 becomes a right superscript of the value in cell A1 and they all written to cell A3.

However, the reaction indication is not like that. So, can somebody please help me to re-arrange the code according to the reaction form.

Please do not withhold your ideas and knowledge.

Best.
 
  • #6
The "end" of superscripts seems to be a bit messy, so I would make them one by one:
Code:
For i = 1 To Len(Range("G1").Value)
    If i <= Len(Range("A1").Value) Or (i >= lengthABCD And i < lengthABCD + Len(Range("E1").Value)) Then
        Range("G1").Characters(i, 1).Font.Superscript = True
    Else
        Range("G1").Characters(i, 1).Font.Superscript = False
    End If
Next i
Where lengthABCD is the sum of the length of the first four cells which has to be calculated first (and G1 has to be filled first, too).

You'll also have to generalize this to work with every row instead of just the first one.
 

FAQ: Superscript Formula in Excel Function CONCATENATE

1. What is a superscript formula in Excel?

A superscript formula in Excel allows you to format text or numbers in a smaller size and raised above the normal text line. This is commonly used for mathematical or chemical formulas, footnotes, and citations.

2. How do I use superscript in the CONCATENATE function in Excel?

To use superscript in the CONCATENATE function, you can either type the caret symbol (^) followed by the number or text you want to superscript, or you can use the "CHAR" function with the specific Unicode number for the superscript character you want to insert.

3. Can I combine superscript with other formatting options in the CONCATENATE function?

Yes, you can combine superscript with other formatting options in the CONCATENATE function. For example, you can use the "&" symbol to combine multiple strings of text and include superscript within one of the strings.

4. How do I remove superscript from text in the CONCATENATE function?

To remove superscript from text in the CONCATENATE function, you can use the "SUBSTITUTE" function to replace the superscript character with a regular character. You can also use the "CLEAN" function to remove all non-printable characters, including superscript.

5. Can I use superscript in other functions besides CONCATENATE in Excel?

Yes, you can use superscript in other functions besides CONCATENATE in Excel. Some common functions that allow for superscript formatting include TEXT, LEFT, RIGHT, FIND, and REPLACE.

Similar threads

Replies
14
Views
2K
Replies
1
Views
2K
Replies
4
Views
3K
Replies
9
Views
2K
Replies
10
Views
4K
Replies
2
Views
4K
Replies
48
Views
8K

Back
Top