+ Reply to Thread
Results 1 to 6 of 6

Formula in ASCII code

Hybrid View

  1. #1
    Registered User
    Join Date
    01-20-2011
    Location
    Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    34

    Formula in ASCII code

    Is it possible to write a formula (working) in ASCII codes in formula bar? For example [=A1+B1] to work if I write say =Char(m)+Char(n) or whatever and this formula to be real and functional. Do I need some additional program or VB? Please help. Thanks in advanve

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Formula in ASCII code

    Unable to understand your question properly since your example not seemed to be perfect

    Char() function accepts Number only as argument, not Text Input.
    =Char(m)+Char(n)


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    01-20-2011
    Location
    Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Formula in ASCII code

    Ok. Sorry being unclear For Example if I write in cell B1 formula = A1 the value in A1 will be typed in B1. The same thing I want to do with ASCII. In ASCII =A1 is (as per my opinion) =CHAR(61)&CHAR(65)&CHAR(49). So, I would like to type the formula in this way, that means if I type similar expression in B1 (as formula) the value from A1 to be typed in B1. Onothere words-to substitute with ASCII codes, but to do the same work as =A1
    Hope now the idea is is understood. Thanks again.

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Formula in ASCII code

    Try this...
    Formula: copy to clipboard
    =INDIRECT(SUBSTITUTE(CHAR(61)&CHAR(65)&CHAR(49),"=",""))

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,422

    Re: Formula in ASCII code

    No, it won't work. Your formula will result in the string of text "=A1", but this will not be evaluated as a formula (the formula being the one with the CHARs in it). You would need another function to evaluate the resultant string as a formula. You could do this in B1:

    Formula: copy to clipboard
    =INDIRECT(CHAR(65)&CHAR(49))


    but that is limited in what it could do (you couldn't include operators or functions, for example).

    In VBA there is an Evaluate function which will act upon a text expression which represents an Excel formula, so to use this in a worksheet you would need a UDF like this:

    Function eval(func As String) 
        Application.Volatile 
        eval = Evaluate(func) 
    End Function
    and then you could have this in B1:

    Formula: copy to clipboard
    =eval(CHAR(65)&CHAR(49))


    The expression could be much more complicated than this, like:

    Formula: copy to clipboard
    =eval("SUM(A" & C1 & ":A" & D1 &")")


    where C1 and D1 contain numbers to define a range in column A to be summed, but I'm not sure why you would want to express it in ASCII code format anyway.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    01-20-2011
    Location
    Bulgaria
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Formula in ASCII code

    Thank you to all of you. I'll try all possibilities and will info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1