+ Reply to Thread
Results 1 to 7 of 7

Turning the 5th digit of a cell to output different number?

  1. #1
    Registered User
    Join Date
    02-10-2016
    Location
    leeds
    MS-Off Ver
    2007
    Posts
    7

    Turning the 5th digit of a cell to output different number?

    Puzzled with this one if you anyone could help me out!!

    If the 5th letter of a cell is either of the below I need to output a different percentage..

    A=10%
    B=20%
    C=30%
    D=40%
    E=50%

    So "326KA80000" would equal "10%"

    Cheers!!

  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: Turning the 5th digit of a cell to output different number?

    With A1 containing some text...326KA80000

    This formula assigns a percent to the 5th character
    Please Login or Register  to view this content.
    EDITED TO INCLUDE THIS ALTERNATIVE THAT ALLOWS FOR SHORT TEXT
    Please Login or Register  to view this content.
    Format B1 as percent.

    In that example, the formula returns: 10%
    Is that something you can work with?
    Last edited by Ron Coderre; 02-10-2016 at 10:11 AM.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    02-10-2016
    Location
    leeds
    MS-Off Ver
    2007
    Posts
    7

    Re: Turning the 5th digit of a cell to output different number?

    Thanks Ron!

    That almost works but the outcome can change and not always in multiples, my actual current requirements are below if you can help me further!

    A= -50%
    B= -30%
    C= -15%
    D= 5%
    E= 15%
    F= 35%

    Thanks again!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Turning the 5th digit of a cell to output different number?

    Create the 2 column table in A1:B6...

    Data Range
    A
    B
    C
    D
    E
    1
    A
    -50%
    326KA80000
    -50%
    2
    B
    -30%
    3
    C
    -15%
    4
    D
    5%
    5
    E
    15%
    6
    F
    35%
    7
    ------
    ------
    ------
    ------
    ------


    Then, this formula entered in E1:

    =VLOOKUP(MID(D1,5,1),A1:B6,2,0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,659

    Re: Turning the 5th digit of a cell to output different number?

    Try with LOOKUP:

    =LOOKUP(MID(A1,5,1),{"A","B","C","D","E","F"},{-50,-30,-15,5,15,35}/100)
    Quang PT

  6. #6
    Registered User
    Join Date
    02-10-2016
    Location
    leeds
    MS-Off Ver
    2007
    Posts
    7

    Re: Turning the 5th digit of a cell to output different number?

    Thank you this works perfectly!!

    Is there any way I can now increase cost price in cell "B1" by the outcome percentage below using just one formula??



    Quote Originally Posted by bebo021999 View Post
    Try with LOOKUP:

    =LOOKUP(MID(A1,5,1),{"A","B","C","D","E","F"},{-50,-30,-15,5,15,35}/100)

  7. #7
    Registered User
    Join Date
    02-10-2016
    Location
    leeds
    MS-Off Ver
    2007
    Posts
    7

    Thumbs up Re: Turning the 5th digit of a cell to output different number?

    Duplicate Duplicate
    Last edited by richyrich92; 02-10-2016 at 12:11 PM.

+ 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. Turning a 6 or 7 digit number into a code containing numbers and letters.
    By MCucuzza in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-16-2016, 04:21 PM
  3. Replies: 17
    Last Post: 02-02-2016, 05:05 AM
  4. [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
  5. [SOLVED] Formatting to make 2 digit number show up at 3 digit number.
    By cadamhill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-18-2012, 06:58 PM
  6. Replies: 4
    Last Post: 09-12-2011, 12:00 PM
  7. Replies: 6
    Last Post: 05-10-2011, 11:30 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