简体   繁体   English

在Excel 2010中将文本转换为数字

[英]converting text to number in excel 2010

I have the following problem in excel, i have a column with the following type of values 我在excel中遇到以下问题,我有一列具有以下类型的值

1.0
2.0
1.0
3.0
4.0

Excel is treating it as text and when i try to follow any steps practically nothing happens Excel将其视为文本,当我尝试执行任何步骤时,实际上什么也没有发生

I selected the values and change their type in properties and nothing happened. 我选择了值并在属性中更改了它们的类型,但没有任何反应。 Then I went to official excel site and followed their steps and still nothing happened 然后我去了excel官方网站,按照他们的步骤进行,仍然没有任何反应

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

I have excel 2010, i tried a few of the solutions but they didnt really give me what I want! 我有excel 2010,我尝试了一些解决方案,但它们并没有真正给我我想要的! If you have a link or solution please provide. 如果您有链接或解决方案,请提供。 Thankyou 谢谢

I would use this formula in another column: 我将在另一列中使用此公式:

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

"B2" standing for the range, where your data is. “ B2”代表数据所在的范围。

Depends what your decimal seperator in your language is. 取决于您所用语言的十进制分隔符。 If it's english the function VALUE should be sufficient. 如果是英语,则功能VALUE应该足够了。

Select the cells you wish to convert and run this short VBA macro: 选择要转换的单元格并运行此简短的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

Here a list of links that might help you with a solution: 这里的链接列表可能会为您提供解决方案:

Excel Formula: Convert Number to Text Excel公式:将数字转换为文本

Excel Easy Text to Numbers Excel简易文字转数字

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM