+ Reply to Thread
Results 1 to 6 of 6

Char & Code Formulas

  1. #1
    Registered User
    Join Date
    11-25-2013
    Location
    San Jose, California, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Char & Code Formulas

    Hi, I came across this formula on an excel forum but there was no story behind it.

    =CHAR(CODE(LEFT($C6,1))+3)&""&CHAR(CODE(MID($C6,2,1))+3)&""&CHAR(CODE(MID($C6,3,1))+3)&""&CHAR(CODE(MID($C6,4,1))+3)

    I was hoping someone could shed light on this! Where and why would we use this formula? A scenario will be very helpful!

    Thanks a lot!

  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: Char & Code Formulas

    Not sure where I'd use something like that, but...
    that formula increments the 1st 4 letters of the text in cell C6 by 3 positions to the right.

    Example:
    C6: AEIOU
    The formula returns: DHLR
    Please Login or Register  to view this content.
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

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

    Re: Char & Code Formulas

    It looks like a simple coding system which takes the first 4 letters of whatever is in C6 and shifts each letter 3 places up the alphabet. So, if you had ABCD in C6 the result from the formula would be DEFG.

    There is quite a bit of redundancy in the formula - it could be simplified to this:

    =CHAR(CODE($C6)+3)&CHAR(CODE(MID($C6,2,1))+3)&CHAR(CODE(MID($C6,3,1))+3)&CHAR(CODE(MID($C6,4,1))+3)

    Hope this helps.

    Pete

  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: Char & Code Formulas

    The formula is taking a 4 character string in the cell and getting the numeric code value of each character then adding 3 to that code value then converting that code value into a new character.

    For example, enter this word in C6: Lost

    The formula returns Orvw.

    Here's how it breaks down:

    CODE("L") = 76 + 3 = 79 = CHAR(79) = O
    CODE("o") = 111 + 3 = 114 = CHAR(114) = r
    CODE("s") = 115 + 3 = 118 = CHAR(118) = v
    CODE("t") = 116 + 3 = 119 = CHAR(119) = w
    ="O"&"r"&"v"&"w"
    =Orvw

    What purpose it serves is hard to say.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    11-25-2013
    Location
    San Jose, California, US
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Char & Code Formulas

    Thank you all! I might use it for any confidential documents..

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

    Re: Char & Code Formulas

    You're welcome. Thanks for the feedback!

    I'm pretty sure the NSA can break that encryption method!

+ 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. [SOLVED] VBA Code needed for introducing a CHAR on the left side of a cell with formula
    By alchavar in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 05-29-2013, 12:25 AM
  2. Wingdings2 Char Code 39 won't display
    By fyrnetics in forum Excel General
    Replies: 4
    Last Post: 03-10-2012, 12:01 AM
  3. Changing a single Char in a string to another ASCII char
    By goofy78270 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-15-2007, 09:45 AM
  4. [SOLVED] 8500 cells with phone number(7 char.), wishing to add area code (10 char.)
    By moparz@gmail.com in forum Excel General
    Replies: 6
    Last Post: 03-10-2006, 01:15 PM
  5. ALT + enter or Char(13) in code
    By JL in forum Excel General
    Replies: 3
    Last Post: 04-08-2005, 01:06 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