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).


ABC
1ChangeUppercaseLowercase
2YesRUMCOKERUMcoke
3YesVODKALEMONVODkalemon
4YesWHISKEYDRYWHIskeydry
5No
RUMCOKERUMCOKE
6NoVODKALEMONVODKALEMON
7NoWHISKEYDRYWHISKEYDRY

<tbody>
</tbody>


Thanks,
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
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)... :LOL:

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

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

Forum statistics

Threads
1,214,657
Messages
6,120,769
Members
448,991
Latest member
Hanakoro

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