+ Reply to Thread
Results 1 to 10 of 10

Help if 4 is the 4th character, replace it with

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    Birkirkara Malta
    MS-Off Ver
    Excel 2010
    Posts
    32

    Post Help if 4 is the 4th character, replace it with

    Hi,

    Good afternoon,

    Can someone help me, i have a code of 22 digits, this represents a lot of staff ie.

    if the 4th character is "4" means DE SALE if "5" means AT SALES
    if the 5th character is "6" means express
    etc etc.
    the meaning of each number is saved on a different sheet.

    which formula is best to use

    i have attached a example.

    your help is much appreciated

    Clif
    Attached Files Attached Files

  2. #2
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Help if 4 is the 4th character, replace it with

    In B2 copied across and down:

    =IFERROR(INDEX(ATT!$B$2:$W$4,MATCH(--MID($A2,COLUMN(A1),1),ATT!$A$2:$A$4,0),COLUMN(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.

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Help if 4 is the 4th character, replace it with

    your example does not represent your data you have 0-9 as valid numbers and your strings are 21 characters long!

    Is the attached along the lines of what you want?
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    05-21-2013
    Location
    Birkirkara Malta
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Help if 4 is the 4th character, replace it with

    Thank you so much, it worked much appreciated

  5. #5
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Help if 4 is the 4th character, replace it with

    Glad to help.

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

  6. #6
    Registered User
    Join Date
    05-21-2013
    Location
    Birkirkara Malta
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Help if 4 is the 4th character, replace it with

    Hi if you have time can you explain the logic please, as on 3rd 4th 5th didn't work. I've attached a second excel maybe i'm doing something wrong
    Attached Files Attached Files

  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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Help if 4 is the 4th character, replace it with

    You didn't extend the lookup ranges!

    =IFERROR(INDEX(ATT!$B$2:$W$11,MATCH(--MID($A2,COLUMN(A1),1),ATT!$A$2:$A$11,0),COLUMN(A1)),"")

  8. #8
    Registered User
    Join Date
    05-21-2013
    Location
    Birkirkara Malta
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Help if 4 is the 4th character, replace it with

    its works thank you all

  9. #9
    Registered User
    Join Date
    05-21-2013
    Location
    Birkirkara Malta
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Help if 4 is the 4th character, replace it with

    thank you so much

  10. #10
    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. 2406 (Windows 11 23H2 64-bit)
    Posts
    81,483

    Re: Help if 4 is the 4th character, replace it with

    My pleasure.

+ 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. replace EACH Nth occurrence a character in a string with another character
    By mattman7 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 06-23-2016, 12:23 PM
  2. How to find and replace % plus two character
    By paradox_108 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-01-2015, 04:56 AM
  3. [SOLVED] How to: Replace each character
    By jamiguel77 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-12-2013, 03:14 PM
  4. Replace only one character in string.
    By ali84pk in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-24-2012, 04:39 PM
  5. automatic character replace?
    By kyegibbon in forum Excel General
    Replies: 2
    Last Post: 10-09-2006, 05:33 AM
  6. How do I replace a BEL Character of 7 with a space
    By KBear in forum Excel General
    Replies: 0
    Last Post: 06-06-2006, 10:50 AM
  7. [SOLVED] How do I replace a character with another?
    By MosesX8 in forum Excel General
    Replies: 6
    Last Post: 06-11-2005, 05: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