+ Reply to Thread
Results 1 to 7 of 7

value function

  1. #1
    tina
    Guest

    value function

    May I know what is wrong over here?

    I have a formula in A1 cell (eq. 3+5 formatted as text) and try to let B1
    have the result of A1. so I set B1 =Value(A1)...it doesn't work but it will
    work if I put =value(3+5)...
    Is there anyone can tell me what is wrong here?


  2. #2
    Peo Sjoblom
    Guest

    Re: value function

    Nothing wrong, that is the way excel works, you need either VBA or and old
    xlm trick which is not recommended since it can crash in earlier versions

    here's the VBA version

    Option Explicit

    Function Eval(myStr As String) As Variant
    Eval = Application.Evaluate(myStr)
    End Function


    =EVAL(A1)

    will return 8

    http://www.mvps.org/dmcritchie/excel/install.htm

    how to install macros or UDFs




    --
    Regards,

    Peo Sjoblom

    Portland, Oregon




    "tina" <[email protected]> wrote in message
    news:[email protected]...
    > May I know what is wrong over here?
    >
    > I have a formula in A1 cell (eq. 3+5 formatted as text) and try to let B1
    > have the result of A1. so I set B1 =Value(A1)...it doesn't work but it
    > will
    > work if I put =value(3+5)...
    > Is there anyone can tell me what is wrong here?
    >



  3. #3
    tina
    Guest

    Re: value function

    Thank you very much
    It's a really help a lot.

    Tina

    "Peo Sjoblom" wrote:

    > Nothing wrong, that is the way excel works, you need either VBA or and old
    > xlm trick which is not recommended since it can crash in earlier versions
    >
    > here's the VBA version
    >
    > Option Explicit
    >
    > Function Eval(myStr As String) As Variant
    > Eval = Application.Evaluate(myStr)
    > End Function
    >
    >
    > =EVAL(A1)
    >
    > will return 8
    >
    > http://www.mvps.org/dmcritchie/excel/install.htm
    >
    > how to install macros or UDFs
    >
    >
    >
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > Portland, Oregon
    >
    >
    >
    >
    > "tina" <[email protected]> wrote in message
    > news:[email protected]...
    > > May I know what is wrong over here?
    > >
    > > I have a formula in A1 cell (eq. 3+5 formatted as text) and try to let B1
    > > have the result of A1. so I set B1 =Value(A1)...it doesn't work but it
    > > will
    > > work if I put =value(3+5)...
    > > Is there anyone can tell me what is wrong here?
    > >

    >
    >


  4. #4
    Kevin Vaughn
    Guest

    Re: value function

    I don't remember where I read this (probably in a John Walkenbach book,) but
    I just tried this and it also worked. I created a Named formla (named range)
    like so:

    EvalCellToLeft =EVALUATE(!F15)


    When you create the named range, just use whatever cell is to the left of
    where you currently are. If you don't want it to be specific to the
    worksheet you are in, use the ! with nothing before it.) Then with this, I
    tried the following and it worked:

    3+5 8
    3*5 15
    3/5 0.6
    3^5 243

    It also worked when I tried the formula in a different worksheet. BTW, the
    formula is of course =EvalCellToLeft
    Also, you could of course name it to anything you wanted. It would not work
    in a different workbook unless you created the named formula there also.
    --
    Kevin Vaughn


    "tina" wrote:

    > Thank you very much
    > It's a really help a lot.
    >
    > Tina
    >
    > "Peo Sjoblom" wrote:
    >
    > > Nothing wrong, that is the way excel works, you need either VBA or and old
    > > xlm trick which is not recommended since it can crash in earlier versions
    > >
    > > here's the VBA version
    > >
    > > Option Explicit
    > >
    > > Function Eval(myStr As String) As Variant
    > > Eval = Application.Evaluate(myStr)
    > > End Function
    > >
    > >
    > > =EVAL(A1)
    > >
    > > will return 8
    > >
    > > http://www.mvps.org/dmcritchie/excel/install.htm
    > >
    > > how to install macros or UDFs
    > >
    > >
    > >
    > >
    > > --
    > > Regards,
    > >
    > > Peo Sjoblom
    > >
    > > Portland, Oregon
    > >
    > >
    > >
    > >
    > > "tina" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > May I know what is wrong over here?
    > > >
    > > > I have a formula in A1 cell (eq. 3+5 formatted as text) and try to let B1
    > > > have the result of A1. so I set B1 =Value(A1)...it doesn't work but it
    > > > will
    > > > work if I put =value(3+5)...
    > > > Is there anyone can tell me what is wrong here?
    > > >

    > >
    > >


  5. #5
    Kevin Vaughn
    Guest

    RE: value function

    Regarding my previous post, I wonder if that is the old XLM trick to which
    Peo is referring.
    --
    Kevin Vaughn


    "tina" wrote:

    > May I know what is wrong over here?
    >
    > I have a formula in A1 cell (eq. 3+5 formatted as text) and try to let B1
    > have the result of A1. so I set B1 =Value(A1)...it doesn't work but it will
    > work if I put =value(3+5)...
    > Is there anyone can tell me what is wrong here?
    >


  6. #6
    Peo Sjoblom
    Guest

    Re: value function

    In pre 2002 versions if you copy the formula to another sheet it will crash
    brutally and you will lose all work

    --
    Regards,

    Peo Sjoblom

    Portland, Oregon




    "Kevin Vaughn" <[email protected]> wrote in message
    news:[email protected]...
    > Regarding my previous post, I wonder if that is the old XLM trick to which
    > Peo is referring.
    > --
    > Kevin Vaughn
    >
    >
    > "tina" wrote:
    >
    >> May I know what is wrong over here?
    >>
    >> I have a formula in A1 cell (eq. 3+5 formatted as text) and try to let B1
    >> have the result of A1. so I set B1 =Value(A1)...it doesn't work but it
    >> will
    >> work if I put =value(3+5)...
    >> Is there anyone can tell me what is wrong here?
    >>



  7. #7
    Kevin Vaughn
    Guest

    Re: value function

    Argh, I did not know that. And I am using 2000. Thanks.
    --
    Kevin Vaughn


    "Peo Sjoblom" wrote:

    > In pre 2002 versions if you copy the formula to another sheet it will crash
    > brutally and you will lose all work
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > Portland, Oregon
    >
    >
    >
    >
    > "Kevin Vaughn" <[email protected]> wrote in message
    > news:[email protected]...
    > > Regarding my previous post, I wonder if that is the old XLM trick to which
    > > Peo is referring.
    > > --
    > > Kevin Vaughn
    > >
    > >
    > > "tina" wrote:
    > >
    > >> May I know what is wrong over here?
    > >>
    > >> I have a formula in A1 cell (eq. 3+5 formatted as text) and try to let B1
    > >> have the result of A1. so I set B1 =Value(A1)...it doesn't work but it
    > >> will
    > >> work if I put =value(3+5)...
    > >> Is there anyone can tell me what is wrong here?
    > >>

    >
    >


+ 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