zoukankan      html  css  js  c++  java
  • EXCEL如何提取文字中包含的数字?

    方法1:=IF(ISERROR(FIND("-",A1)),"","-")&MID(SUM(MID(101&A1,2+LARGE(ISNUMBER(-MID(1&A1,COLUMN(1:1),1))COLUMN(1:1),ROW($1:$50)),1)10^ROW($2:$51))%,2,15)

    方法2:按ALT+F11,插入-模块,复制下列语句
    Function SplitNumEng(str As String, sty As Byte)
    Dim StrA As String
    Dim StrB As String
    Dim StrC As String
    Dim i As Integer
    Dim SigS As String
    For i = 1 To Len(str)
    SigS = Mid(str, i, 1)
    If SigS Like "[a-zA-Z]" Then
    StrA = StrA & SigS
    ElseIf SigS Like "#" Then
    StrB = StrB & SigS
    Else
    StrC = StrC & SigS
    End If
    Next i
    Select Case sty
    Case 1
    SplitNumEng = StrA
    Case 2
    SplitNumEng = StrB
    Case Else
    SplitNumEng = StrC
    End Select
    End Function
    比如你的数据在A1 
    BI输入 =SplitNumEng(A1,1) 表示提取字母

    =SplitNumEng(A1,2) 表示提取数字 
    =SplitNumEng(A1,3)表示提取中文

  • 相关阅读:
    sprintf的用法
    sscanf
    Decode the tape
    poj 1579 Function Run Fun
    Where's Waldorf?
    uva Andy's First Dictionary
    UVA Hangman Judge
    UVa Automatic Editing
    界面设计规范
    web标准下的web开发流程思考
  • 原文地址:https://www.cnblogs.com/nxld/p/6099990.html
Copyright © 2011-2022 走看看