Forum Discussion
Complex Cell Format, Maybe!!!
How about use text format plus helper column:
1. Enter your values as text (e.g., '6/18 with an apostrophe).
2. In a helper column, extract or count based on the text.
=IF(A1="6/18", 1, 0)
- m_tarlerJun 26, 2025Bronze Contributor
alternatively you could just enter the 2 values in adjacent cells
if you need a 'report' you can then show it using = A1 & "/" & B1
- Ituah_ImafidonJun 29, 2025Copper Contributor
Thanks for the good alternative, but it has a little challenge. You see the visual acuity (6/12...), they tend sometimes to have superscripts, and when I follow the method above, it returns the superscript to an ordinary number.
E.g.: 6/12-2, the -2 is supposed to be in superscript format.
How can I remedy that, or is it impossible???
Thanks for your assistance.
- JKPieterseOct 07, 2025Silver Contributor
If you are fine with a bit of VBA you can make this happen.
Right-click the worksheet's tab and choose "View Code". Paste this code in the window that opens:
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Cells.Count = 1 Then TurnIntoSuperScript Target End If End Sub
Next, from the menu, choose Insert, Module. Paste in this code:
Sub TurnIntoSuperScript(cl As Range) Dim val As Variant Dim pos As Long val = cl.Value pos = InStr(val, "-") If pos > 0 Then With cl.Characters(Start:=1, Length:=pos - 1).Font .Superscript = False End With With cl.Characters(Start:=pos, Length:=Len(val) - pos + 1).Font .Superscript = True End With Else cl.Font.Subscript = False End If End Sub
Now try entering a fraction into a cell on the worksheet.
- Ituah_ImafidonJun 28, 2025Copper Contributor
So I tried it and it looks good, my new problem is that the subscript is no longer a subscript.
Like I have a 6/12-1 w/ the "-1" as the subscript, but now no longer a subscript. Is this possible for me to retain the "-1" subscript using the formula above?
- Ituah_ImafidonJun 28, 2025Copper Contributor
I'll give it a try.
Thank you.