Forum Discussion

tulaneboi's avatar
tulaneboi
Copper Contributor
Aug 04, 2023

Formatting frustration in excel

I have a code column that contains values like:

 

250.00

1.280923E+14

452.20

 

All I want is to the convert the scientific notation values to their full number. I have tried so many different methods but the following issues arise:

 

1. If I try =trim(columnwith#s) then the scientific notation numbers convert properly but the numbers with decimals turn into 250 and 452.2.

 

2. Converting the whole column to text. The scientific notation columns do not change.

 

3. Mass inserting an apostrophe before each number using the flash fill. This does not change the scientific notation numbers.

 

I cannot go and change each cell with scientific notation one by one because there are thousands of rows.

 

My ideal situation is that the code column is in text format but with the full numbers (no scientific notation and maintain all points before and after the decimal). Is there anyway for me to convert the scientific notation to the full number in text format while keeping all numbers with the decimals the same? Please advise.

6 Replies

  • tulaneboi 

    If you set the horizontal alignment of the column to General, are the values (in particular those using scientific notation) left-aligned or right-aligned?

    If they are left-aligned, they are already text values. You can convert them to numbers, but you won't be able to retrieve the extra digits that were not displayed.

    If they are right-aligned, prefixing the values with ' should work...

    • tulaneboi's avatar
      tulaneboi
      Copper Contributor
      It looks like they are right aligned. However, prefixing them with an apostrophe 1 by 1 would be nearly impossible since there are thousands of rows with the scientific notation. Is there any way to do this automatically?
      • HansVogelaar's avatar
        HansVogelaar
        MVP

        tulaneboi 

        Select the range that you want to convert.

        Run the macro listed below.

        Blank cells and cells with formulas will be ignored.

        Sub AddApostrophe()
            Dim cel As Range
            Application.ScreenUpdating = False
            For Each cel In Selection
                If Not cel.HasFormula Then
                    If cel.Value <> "" Then
                        cel.Value = "'" & cel.Value
                    End If
                End If
            Next cel
            Application.ScreenUpdating = True
        End Sub

Resources