Get the column number in formula

Posted by: jars on 8 September 2017, 2:33 pm EST

  • Posted 8 September 2017, 2:33 pm EST

    Hello,

     There is a way(property, method..etc) to get the columns numbers found in a formula?, for example :

    AND(N2>Sheet2!$B$2,N2<=Sheet2!$C$2)   '###Return  the numbers of columns for N, Sheet2:B, Sheet2:C

    or

    COUNTIF(K:K,P2) '#### Return the numbers of columns for K and P

     of

    VLOOKUP(E2,Sheet2!$A$2:$D$6,"4",0)  '### Return the numbers of columns for E, Sheet2: A, Sheet2: D

    And so on...

    Thanks for your help.

     

  • Replied 8 September 2017, 2:33 pm EST

    You can do what you want to do with the Expression Class, but it isn't easy, we have no sample code and you would need to dig into the Expression Class and learn how to use it. Alternatively, and possibly simpler if you know in advanced what formulas you are trying to parse you could simply get the string representation of the formula from the Formula property, and parse it as you would any string.
  • Replied 8 September 2017, 2:33 pm EST

    Paul,

     How could i get started to discover the Expression Class? I have interest in doing this, could you please guide me on that?

     Thanks

  • Replied 8 September 2017, 2:33 pm EST

    Hello,

    It Represents the abstract class from which all expression types derive. 

     
     
      These are the members for FarPoint.CalcEngine.Expression
    ,
          FarPoint.CalcEngine.BinaryOperatorExpression

          FarPoint.CalcEngine.ConstantExpression

          FarPoint.CalcEngine.ExternalReferenceExpression

          FarPoint.CalcEngine.FunctionExpression

          FarPoint.CalcEngine.NameExpression

          FarPoint.CalcEngine.ParenthesesExpression

          FarPoint.CalcEngine.ReferenceExpression

          FarPoint.CalcEngine.UnaryOperatorExpression

     

    You may find more about this in Spread's help file under:

    FarPoint.CalcEngine Assembly > FarPoint.CalcEngine Namespace : Expression Class

    Thanks,

     

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels