Results 1 to 10 of 11

Thread: Val Function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member Transformer's Avatar
    Join Date
    Mar 2012
    Posts
    91
    Rep Power
    13

    Val Function

    This function returns the numbers found in a string which is passed as an argument.
    It stops reading the string at the first character that it can't recognize as part of a number.
    But it dont stop on spaces.

    Syntax: Val(string)

    Example:
    Code:
    Val("1234Excel")
    would return 1234

    Code:
    Val("1234.5Excel")
    would return 1234.5

    Code:
    Val("1234.5.56Excel")
    would return 1234.5

    Code:
    Val("1234 23 34")
    would return 12342334

    Code:
    Val("12323 .5  6")
    would return 12323.56

    Regards,
    Transformer
    Last edited by Admin; 06-11-2012 at 04:14 PM. Reason: edited a typo
    Regards,

    Transformer

Similar Threads

  1. UDF (user defined function) replacement for Excel's DATEDIF function
    By Rick Rothstein in forum Rick Rothstein's Corner
    Replies: 21
    Last Post: 03-07-2015, 09:47 PM

Tags for this Thread

Posting Permissions

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