Changing upper case to lower case for 3 letters of a word

Milos

Board Regular
Joined
Aug 28, 2016
Messages
121
Office Version
  1. 365
Platform
  1. Windows
Hello all,

Would it be possible to alter a whole column (as shown in column B) so that any upper case
entries remain upper case for the first three letters of a word but all other letters change to lower case (as shown in column C). However this would only apply to particular cells within the column as specified by another column (as shown in column A).


[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Change[/TD]
[TD]Uppercase[/TD]
[TD]Lowercase[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Yes[/TD]
[TD]RUMCOKE[/TD]
[TD]RUMcoke[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Yes[/TD]
[TD]VODKALEMON[/TD]
[TD]VODkalemon[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Yes[/TD]
[TD]WHISKEYDRY[/TD]
[TD]WHIskeydry[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]No
[/TD]
[TD]RUMCOKE[/TD]
[TD]RUMCOKE[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]No[/TD]
[TD]VODKALEMON[/TD]
[TD]VODKALEMON[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]No[/TD]
[TD]WHISKEYDRY[/TD]
[TD]WHISKEYDRY[/TD]
[/TR]
</tbody>[/TABLE]


Thanks,
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Something like this in C2 drag down:
Code:
=IF(A2="Yes",UPPER(LEFT(B2,3))&LOWER(RIGHT(B2,LEN(B2)-3)),B2)
 
Upvote 0
Thanks BQardi that is perfect! I was struggling with Upper an lower case formatting with the IF function.

I am wanting to specify this code a little more if possible. Do know how would alter the code so that the logical test part of the IF function ("Yes" for the example above) just has to contain the values "yes" and this function will work.

For example if there were a multitude of cells down column A the cells all contained different values such as "Yes", "Yesterday", YesserieBob" "Yesabel" and it would still pick up the value "Yes" and change the cell according to the IF function. I am trying to implement the SEARCH function to no avail.
 
Upvote 0
Yeah, should be something like this:
Replace:
Code:
=IF([COLOR=#ff0000]A2="Yes"[/COLOR],UPPER(LEFT(B2,3))&LOWER(RIGHT(B2,LEN(B2)-3)),B2)
with:
Code:
=IF([COLOR=#ff0000]IFERROR(SEARCH("yes",A2),0)>0[/COLOR],UPPER(LEFT(B2,3))&LOWER(RIGHT(B2,LEN(B2)-3)),B2)
 
Upvote 0
Thanks again. Is there also a possibility for the function to outline more than one text option?

Lets say I added another word into column A so the options were Yes, No and affirmative. Could I rework the formula so that two groups of text to apply in this function ("yes" and "affirmative").
 
Upvote 0
Yes you can use the OR function:
Code:
=IF([COLOR=#ff0000]OR[B]([/B][/COLOR]IFERROR(SEARCH("yes",A2),0)>0[COLOR=#ff0000],IFERROR(SEARCH("affirmative",A2),0)>0[/COLOR][COLOR=#ff0000][B])[/B][/COLOR],UPPER(LEFT(B2,3))&LOWER(RIGHT(B2,LEN(B2)-3)),B2)
 
Upvote 0
Legend, thanks man.

I am always so close with my coding but just a little mistake throws the whole thing off!
 
Upvote 0
Just to show that Excel usually has several ways of accomplishing something, here's another option:

=IF(SUM(COUNTIF(A2,{"*yes*","*affirmative*"})),UPPER(LEFT(B2,3))&LOWER(MID(B2,4,99)),B2)
 
Upvote 0
Had to laugh seeing a question with example data involving Rum & Coke being answered by BQardi (Bacardi)... :laugh:

Cheers,
~ Jim
 
Upvote 0
Had to laugh seeing a question with example data involving Rum & Coke being answered by BQardi (Bacardi)... :laugh:

Cheers,
~ Jim
Hahaha...
I'm so used to my username that I never even realized this.
That is soooo funny...:laugh:
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top