+ Reply to Thread
Results 1 to 6 of 6

Extracting Characters from strings.

  1. #1
    Registered User
    Join Date
    09-18-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Extracting Characters from strings.

    Hi All

    Need some rookie help to understand the following.

    When using the MID or RIGHT functions to return charaters from a string, why doesn't the function start from a "0"?

    example: Cell A1 = 0.08
    Cell A2 = 0.10


    RIGHT(A1,2) returns "08" as intentend, though RIGHT(A2,2) RETURNS ".1", ignoring the first 0. instead of "10"


    How can I retrive the required caracters if it starts with a "0"

    Thanks for you help.

  2. #2
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Extracting Characters from strings.

    Hi,

    That's because that 0 isn't really there, you probably have the cell formatted Number with 2 decimal places.

  3. #3
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Extracting Characters from strings.

    The value you see is the formatted value.
    The actual value is what's in the cell. Cell A2 contains 0.1 and it happens to be formatted as 0.10

    You'll need to convert the value to formatted text.
    Try this regular forumula, copied down
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  4. #4
    Valued Forum Contributor jtakw's Avatar
    Join Date
    05-05-2018
    Location
    CA, USA
    MS-Off Ver
    2016
    Posts
    668

    Re: Extracting Characters from strings.

    If you really want 10 as the result, you can do this:

    Excel 2016 (Windows) 64 bit
    A
    B
    C
    1
    0.08
    08
    2
    0.10
    10
    Sheet: Sheet32

    Excel 2016 (Windows) 64 bit
    C
    1
    =RIGHT(TEXT(A1,"0.00"),2)
    Sheet: Sheet32

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Extracting Characters from strings.

    Or do this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    v A B
    1 0.08 08
    2 0.1 10
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Registered User
    Join Date
    09-18-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Extracting Characters from strings.

    Thanks everyone, I understand the function better now and this has solved my issue,

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Extracting Strings from .PDF
    By DaProStudent in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-02-2017, 04:31 PM
  2. [SOLVED] Extracting Multiple types of Text Characters from Text Strings
    By DannyGIS in forum Excel General
    Replies: 9
    Last Post: 12-14-2016, 09:35 PM
  3. [SOLVED] Help, please, with extracting numbers from strings in VBA
    By shennin202 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-22-2013, 08:19 PM
  4. Extracting strings from Sub-name
    By konfis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2012, 11:08 AM
  5. Extracting Text Strings
    By rs585832 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-13-2011, 04:28 PM
  6. Extracting strings
    By Esinem in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-25-2009, 09:29 AM
  7. Extracting mid strings from a cell
    By Sultix in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-04-2009, 09:53 AM

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