Closed Thread
Results 1 to 4 of 4

Thread: Convert a generic language expression to excel formula?

  1. #1
    arunsinbox is offline Newbie
    Join Date
    Sep 2008
    Posts
    3
    Rep Power
    0

    Exclamation Convert a generic language expression to excel formula?

    Dear guyz/galz

    Is there any method / function (in any language) to convert a generic language expression to an excel formula ?

    By generic language expression i mean something like this:

    IF (Department="A" OR Department="B" OR Department ="C") then
    Grade="1"
    end if

    (I consider only expressions which can be converted to a single line formula)

    The converted excel formula should be like this:
    =IF(OR(AB1="A";AB1="B";AB1 ="C");"1";"0")

    AB1 is the cell containing department, no need to worry about tat i can map tat using info in an XML.

    Thank u all
    Arun

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Jul 2006
    Location
    Amherst, New York, United States
    Posts
    6,277
    Blog Entries
    26
    Rep Power
    20

    Re: Convert a generic language expression to excel formula?

    As far as I know, there is no native function or language construct to any programming language to do what you are asking. However, with basic regular expressions and string parsing functions (which almost all programming languages support) you can create your own function. You are essentially creating your own "language" and a compiler for it. Your application, is fairly trivial.

  4. #3
    Join Date
    Jan 2008
    Posts
    1,725
    Blog Entries
    4
    Rep Power
    29

    Re: Convert a generic language expression to excel formula?

    So basically, you want to convert:
    Code:
    IF (Department="A" OR Department="B" OR Department ="C") then
    Grade="1"
    end if
    into

    Code:
    =IF(OR(AB1="A";AB1="B";AB1 ="C");"1";"0")
    using some language like C++? If you do, I'm not sure if there is anything prewritten, but with logic this simple, it wouldn't be hard to write your own converter.

  5. #4
    arunsinbox is offline Newbie
    Join Date
    Sep 2008
    Posts
    3
    Rep Power
    0

    Re: Convert a generic language expression to excel formula?

    Thankz to u all for trying to help me.

    Yes tats wat i exactly want. Now wat i am doing is this:

    I am constructing a binary tree from the first code

    Then parse tat tree to make the second code.

    Any helpful tips for these, or any suggestions?

    Thankz again

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to Add a Formula for Excel
    By Daisy09 in forum C# Programming
    Replies: 1
    Last Post: 02-15-2011, 10:18 AM
  2. Excel 2007 and excel 2010
    By secondrate in forum Visual Basic Programming
    Replies: 1
    Last Post: 06-16-2010, 04:49 AM
  3. Import form Excel, filtr, export to excel
    By seatcordobawrc in forum Pascal and Delphi
    Replies: 1
    Last Post: 03-30-2010, 02:30 PM
  4. need to convert html file to excel, what is the best way?
    By fftw_ayi in forum General Programming
    Replies: 6
    Last Post: 03-14-2009, 09:53 AM
  5. convert frx report to excel file using visual foxpro 8
    By jov in forum General Programming
    Replies: 0
    Last Post: 11-13-2007, 06:43 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts