在 excel 2010 年将文本转换为数字

converting text to number in excel 2010

我在 excel 中遇到以下问题, 我有一列具有以下类型的值

1.0
2.0
1.0
3.0
4.0

Excel 将其视为文本,当我尝试执行任何步骤时几乎没有任何反应

我选择了值并在属性中更改了它们的类型,但没有任何反应。然后我去了官方 excel 网站并按照他们的步骤操作,仍然没有任何反应

https://support.office.com/en-us/article/convert-numbers-stored-as-text-to-numbers-40105f2a-fe79-4477-a171-c5bad0f0a885

我有 excel 2010,我尝试了一些解决方案,但它们并没有真正满足我的需求!如果您有 link 或解决方案,请提供。谢谢

此处列出了可能有助于您解决问题的链接:

Excel Formula: Convert Number to Text

Excel Easy Text to Numbers

Select 您要转换的单元格和 运行 这个简短的 VBA 宏:

Sub numerify()
    Dim rng As Range, v As Double, r As Range

    Set rng = Intersect(Selection, ActiveSheet.UsedRange)

    For Each r In rng
        If r.Value <> "" Then
            v = CDbl(Trim(r.Text))
            r.Clear
            r.Value = v
        End If
    Next r

End Sub

我会在另一列中使用这个公式:

=VALUE(SUBSTITUTE(B2;".";","))

"B2"代表你的数据所在的范围。

取决于您使用的语言中的小数点分隔符。如果是英文,函数 VALUE 应该足够了。