Results 1 to 3 of 3

Thread: Extracting last 2 digits from a cell
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Nov 2018
    Posts
    10
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Extracting last 2 digits from a cell

    Hi

    Need some help, but not sure if the below will make sense, so here goes:

    Assume cell A2 has a numerical value of 1489459. I am looking to capture just the last 2 digits of that number. The RIGHT(A2,2) formula gives me the correct output, but I think this formula formats the last 2 digits as text, not a number. So when I input a formula into another cell asking if those last 2 digits are greater than/equal to x, the formula doesn't work cause the RIGHT formula is classifying the data as text.

    If my rambling above makes any sense, does anyone have any suggestions? I tried just changing the formatting of the cells with the RIGHT formulas to number, but that didn't make the IF greater than/equal to formulas work.

    Thanks!

  2. #2
    Board Regular Tim_Excel_'s Avatar
    Join Date
    Jul 2016
    Posts
    512
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    4 Thread(s)

    Default Re: Extracting last 2 digits from a cell

    Code:
    =int(right(a2,2))
    Always make a backup of your data before trying out any code

    Before you ask why my code is not working: have you checked if the references are correct? Are you referring to the correct Workbook/-sheet?

    Use [CODE] tags when pasting code in your posts

  3. #3
    New Member
    Join Date
    Nov 2018
    Posts
    10
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Extracting last 2 digits from a cell

    Thanks!

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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