+ Reply to Thread
Results 1 to 3 of 3

Return the first digit in a cell value

  1. #1
    Registered User
    Join Date
    06-25-2014
    Location
    Singapore
    MS-Off Ver
    2007/2010
    Posts
    55

    Return the first digit in a cell value

    Hi all,

    Got this puzzling problem that need your help!

    Imagine a cell has a value of "008281" at A1
    I want to return the first digit of the 6 digits in A1 which will be "0" in A2.

    I tried using the formulae in A2 with "=left(A1,1), it returns "8" instead. WEIRD!!

    Anyone can help me on this -.- brain cells dying just trying to solve this

    Thanks & Regards,
    Ivan Chng

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

    Re: Return the first digit in a cell value

    You're discovering the difference between "actual value" and "displayed value".
    You probably have cell A1 formatted to display leading zeros. The actual value is: 8281.

    If all values will display as 6-characters and you want to pull the left digit, try this:
    Please Login or Register  to view this content.
    or this:
    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

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Return the first digit in a cell value

    if it is returning 8 then the value in a1 is 8261 formatted custom 000000
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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. Color a single digit in a mult-digit number cell
    By Phyllis in forum Excel General
    Replies: 8
    Last Post: 09-30-2022, 04:22 PM
  2. Return double digit month
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2017, 05:05 AM
  3. [SOLVED] LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash
    By david gonzalez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-08-2014, 12:57 AM
  4. Adding a digit after the first digit of a cell
    By RickCov in forum Excel General
    Replies: 4
    Last Post: 02-16-2012, 08:03 AM
  5. Return last digit in cell as a number
    By Jogier505 in forum Excel General
    Replies: 7
    Last Post: 02-20-2010, 07:59 PM

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