Capitalise every second/third word

parsnipsnatcher

New Member
Joined
Oct 26, 2021
Messages
2
Office Version
  1. 2019
Platform
  1. Windows
How do I capitalise every other word but have the rest normal?

Would look like this:

John Oscar WILLIAMS
Amelia Rose RICHARDS

or

The quick BROWN fox jumps OVER the lazy DOG.

Is that even possible at all?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
As you are using XL2019 let do it with LET and FILTERXML:

Book1
AB
1the quick brown fox jumps over the lazy dogthe quick BROWN fox jumps OVER the lazy DOG
2john oscar williamsjohn oscar WILLIAMS
3amelia rose richardsamelia rose RICHARDS
Sheet1
Cell Formulas
RangeFormula
B1:B3B1=LET( WordsArray,FILTERXML("<OPEN><ELEMENT>"&SUBSTITUTE(A1," ","</ELEMENT><ELEMENT>")&"</ELEMENT></OPEN>","//ELEMENT"), ReCreate,IFERROR(IF(MOD(ROW($1:$20),3)=0,UPPER(WordsArray),WordsArray),""), TEXTJOIN(" ",1,ReCreate) )


if you want to change which word have to be capitalize change 3 in MOD function.
 
Upvote 0
I've checked FILTERXML but not LET...
Then

Book1
AB
1the quick brown fox jumps over the lazy dogthe quick BROWN fox jumps OVER the lazy DOG
2john oscar williamsjohn oscar WILLIAMS
3amelia rose richardsamelia rose RICHARDS
Sheet1
Cell Formulas
RangeFormula
B1:B3B1=TEXTJOIN(" ",1,IFERROR(IF(MOD(ROW($1:$20),3)=0,UPPER(FILTERXML("<OPEN><ELEMENT>"&SUBSTITUTE(A1," ","</ELEMENT><ELEMENT>")&"</ELEMENT></OPEN>","//ELEMENT")),FILTERXML("<OPEN><ELEMENT>"&SUBSTITUTE(A1," ","</ELEMENT><ELEMENT>")&"</ELEMENT></OPEN>","//ELEMENT")),""))
 
Upvote 0
Solution
Thank you so much, this worked for me!
I've checked FILTERXML but not LET...
Then

Book1
AB
1the quick brown fox jumps over the lazy dogthe quick BROWN fox jumps OVER the lazy DOG
2john oscar williamsjohn oscar WILLIAMS
3amelia rose richardsamelia rose RICHARDS
Sheet1
Cell Formulas
RangeFormula
B1:B3B1=TEXTJOIN(" ",1,IFERROR(IF(MOD(ROW($1:$20),3)=0,UPPER(FILTERXML("<OPEN><ELEMENT>"&SUBSTITUTE(A1," ","</ELEMENT><ELEMENT>")&"</ELEMENT></OPEN>","//ELEMENT")),FILTERXML("<OPEN><ELEMENT>"&SUBSTITUTE(A1," ","</ELEMENT><ELEMENT>")&"</ELEMENT></OPEN>","//ELEMENT")),""))
 
Upvote 0
Happy to help.
BTW: that's weird that MS add FILTERXML into O2019 but not LET (I did not check other exclusive O365 functions).
 
Upvote 0
The Filterxml function came out in 2013
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

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