+ Reply to Thread
Results 1 to 10 of 10

Extracting 1 character from a position from the right of a string

  1. #1
    Registered User
    Join Date
    07-11-2019
    Location
    Cambridgeshire
    MS-Off Ver
    Office365
    Posts
    6

    Extracting 1 character from a position from the right of a string

    Hello

    I have a question that I have been searching google for hours.

    In cell B6 I have a binary code. (for example 01000001000 or 110)
    On the right side I have a table that I need to then extract that data from Right to left.
    Table.png

    I need Bit 0 to have the 1st digit from the right
    Bit 1 needs to have the 2nd digit from the right
    Bit 2 needs to have the 3rd digit from the right

    I tried to use =Right Function but it isn't specific for for the position from right just number of characters to include

    Any ideas?

    Thanks

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: Extracting 1 character from a position from the right of a string

    See yellow banner at top of of how to post a sample file.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Extracting 1 character from a position from the right of a string

    Assuming that cell under the heading "Bit15" is C6, try this in that cell then copy over to R6:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Extracting 1 character from a position from the right of a string

    Try this under Bit15 and copy across:

    =MID($A1,COLUMNS(A:$O),1)

    assuming your binary string is in A1.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,737

    Re: Extracting 1 character from a position from the right of a string

    Another way - this is for Bit15:

    =IF(LEN($B$6)<=(16-COLUMNS($B:B)),"",MID($B$6,LEN($B$6)-(16-COLUMNS($B:B)),1))

    then copy across. It shows blanks for any binary digits which are larger than B6.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    07-11-2019
    Location
    Cambridgeshire
    MS-Off Ver
    Office365
    Posts
    6

    Re: Extracting 1 character from a position from the right of a string

    This worked Perfectly!
    Thank you so much

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Extracting 1 character from a position from the right of a string

    Which of us are you addressing? You were offered three solutions.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Registered User
    Join Date
    07-11-2019
    Location
    Cambridgeshire
    MS-Off Ver
    Office365
    Posts
    6

    Re: Extracting 1 character from a position from the right of a string

    Quote Originally Posted by WideBoyDixon View Post
    Assuming that cell under the heading "Bit15" is C6, try this in that cell then copy over to R6:

    Please Login or Register  to view this content.
    WBD
    This was the one I tried 1st that worked

    I did try and quote it but failed

    Regards

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,980

    Re: Extracting 1 character from a position from the right of a string

    So what about the rest of us? I think it would be polite to thank everyone who offered help, don't you?

  10. #10
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Extracting 1 character from a position from the right of a string

    Actually, since you're on O365, you could just put this in C6:

    Please Login or Register  to view this content.
    That would fill in the rest of the row automatically since it would "spill".

    WBD

+ 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. Position of first non-alphanumeric character in a string without VBA Code
    By mmasher99 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-12-2021, 04:58 PM
  2. [SOLVED] find the character position in a string of the last occurrence of a nominated character
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2014, 11:52 PM
  3. Finding the nth position of a character within a text string
    By StevenAlberta in forum Excel General
    Replies: 5
    Last Post: 10-11-2013, 04:04 AM
  4. Replies: 6
    Last Post: 05-02-2011, 10:40 AM
  5. Replies: 10
    Last Post: 11-24-2010, 03:21 PM
  6. Find Character Position in String
    By SportsDave in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-21-2006, 04:49 PM
  7. Function to return Character Position of Xth character within a string
    By Andibevan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-09-2005, 11:05 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