Hi, I've been trying to find an alternative to the substitute function where im not limited to the 64 limit nesting rule. At the moment my current forumla has hit the cap. I've tried using vlookup with a table but it doesn't give me the same desired result.
What the forumla does is this, in one coloumn I have a bunch of text that isn't formatted properly and by using the proper function it puts all the text in the proper case format but I need certain words in uppercase or lowercase, hence the need for the substitute formula. Now in the adjacent column to the text I have the below formula and it would make the necessary corrections for me and would output the full string as I pasted it in.
The list of words that would need changing would grow over time which is why i've already hit the 64 formula nesting limit. I tried the table method as that would have been easier to add to later on. I haven't really done any UDF stuff so I don't really know where to start with it.
Example Data:
Input Output
Column A Column B
hi, i i Am sAMPLE DATA Hi, I Am Sample Data
tHis is From ME This is from Me
pLease heLp Please Help
Original Formula:
=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(PROPER(B7), "Ul>", "ul>"), "P>", "p>"), "From", "from"), " The ", " the "), " And ", " and "), " To ", " to "), " A ", " a "), " Is ", " is "), " As ", " as "), "Li>", "li>"), "Cm", "cm"), "Mm", "mm"), "Led", "LED"), "Of", "of"), " Or ", " or "), "&Nbsp;", ""), "Kg", "kg"), "Vesa", "VESA"), "Lcd", "LCD"), " X ", " x "), "Tv", "TV"), "At ", "at "),"Dc", "DC"), "Ac ", "AC "), "Usb", "USB"), "Fm", "FM"), " Dab ", " DAB "),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <", "<"),"> ",">"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <", "<"),"> ",">"),"&Amp;", "&"),"Center", "Centre"),"Color", "Colour"), "Aluminum", "Aluminium"),"'S ", "'s "),"Mdf", "MDF"),"Strong>", "strong>"),"Gsm", "GSM"),"&Deg;", "°"),"&Ndash;", "–"),"Ltr", "ltr"), "Cc", "cc"),"Hp", "hp"),"Rpm", "RPM"))
Any help would be much appreciated, Im not sure how to attach spreadsheets (is possible) so apologies if the post is a little messy.
Thanks in advance
What the forumla does is this, in one coloumn I have a bunch of text that isn't formatted properly and by using the proper function it puts all the text in the proper case format but I need certain words in uppercase or lowercase, hence the need for the substitute formula. Now in the adjacent column to the text I have the below formula and it would make the necessary corrections for me and would output the full string as I pasted it in.
The list of words that would need changing would grow over time which is why i've already hit the 64 formula nesting limit. I tried the table method as that would have been easier to add to later on. I haven't really done any UDF stuff so I don't really know where to start with it.
Example Data:
Input Output
Column A Column B
hi, i i Am sAMPLE DATA Hi, I Am Sample Data
tHis is From ME This is from Me
pLease heLp Please Help
Original Formula:
=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(PROPER(B7), "Ul>", "ul>"), "P>", "p>"), "From", "from"), " The ", " the "), " And ", " and "), " To ", " to "), " A ", " a "), " Is ", " is "), " As ", " as "), "Li>", "li>"), "Cm", "cm"), "Mm", "mm"), "Led", "LED"), "Of", "of"), " Or ", " or "), "&Nbsp;", ""), "Kg", "kg"), "Vesa", "VESA"), "Lcd", "LCD"), " X ", " x "), "Tv", "TV"), "At ", "at "),"Dc", "DC"), "Ac ", "AC "), "Usb", "USB"), "Fm", "FM"), " Dab ", " DAB "),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <", "<"),"> ",">"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <","<"),"> ",">")," <", "<"),"> ",">"),"&Amp;", "&"),"Center", "Centre"),"Color", "Colour"), "Aluminum", "Aluminium"),"'S ", "'s "),"Mdf", "MDF"),"Strong>", "strong>"),"Gsm", "GSM"),"&Deg;", "°"),"&Ndash;", "–"),"Ltr", "ltr"), "Cc", "cc"),"Hp", "hp"),"Rpm", "RPM"))
Any help would be much appreciated, Im not sure how to attach spreadsheets (is possible) so apologies if the post is a little messy.
Thanks in advance