代码之家  ›  专栏  ›  技术社区  ›  user9431057

表达式错误:名称'Text.BeforeDelimiter分隔符“没被认出来。Excel 2016版

  •  0
  • user9431057  · 技术社区  · 7 年前

    26567-5698
    51254-5458
    6954-1545
    45415
    56541
    5621
    ..
    

    有些以前有4位数 - - . 对于那些 - 在两者之间,我喜欢提取第一部分(在分隔符之前)。

    if  
        Text.Length(Text.BeforeDelimiter([MyCol], "-")) = 4   
      then
        "0" & Text.Start([MyCol],4)
     else if  
         Text.Length(Text.BeforeDelimiter([MyCol], "-")) = 5   
      then 
         Text.Start([MyCol],5)
    else
       [MyCol]
    

    0 和前4位数字。否则,我要前5位数字。

    当我执行上述操作时,会出现以下错误:

    确保拼写正确。

    documentation 我在跟踪。

    我正在使用Excel 2016。我一直在找,找不到任何与此有关的东西。任何帮助都将不胜感激。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Alexis Olson    7 年前

    您可以使用其他文本函数进行变通。

    Left  = try Text.Start([MyCol], Text.PositionOf([MyCol], "-")) otherwise [MyCol]
    Right = try Text.Range([MyCol], Text.Length([Left]) + 1) otherwise null