Combining Vlookup and Change Sentence Case into one formula

VBA learner ITG

Active Member
Joined
Apr 18, 2017
Messages
267
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
hi all,

I need your guidance please.

I have a simple vlookup formula which returns a value. But I need to change the returned value sentence case to capital letters for each word.

=IFERROR(VLOOKUP($C4,'MASTER PLOF'!$A:$C,2,FALSE)," ")
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi there. Use the PROPER function wrapped around your existing formula like this:
Book1
C
10
Sheet4
Cell Formulas
RangeFormula
C10C10=PROPER(IFERROR(VLOOKUP($C4,'MASTER PLOF'!$A:$C,2,FALSE)," "))
 
Upvote 0
Hi there. Use the PROPER function wrapped around your existing formula like this:
Book1
C
10
Sheet4
Cell Formulas
RangeFormula
C10C10=PROPER(IFERROR(VLOOKUP($C4,'MASTER PLOF'!$A:$C,2,FALSE)," "))

Hi jmacleary,

Can I get your adivce again as the "PROPER" formula has worked on majority of cells but I am finding where there are words such as: Goodfella's Thin its changing the letter after the Apostrophe to a capital letter for example: Goodfella'S Thin.

Is there a way around this issue?
 
Upvote 0
Apologies, I should have explained myself clearer.

I have amended the formula to factor in this "'S" issue but is there a way to capture all instances where there is an Apostrophe?

Current new formula below.

=SUBSTITUTE(PROPER(IFERROR(VLOOKUP($C4,'MASTER PLOF'!$A:$C,2,FALSE)," ")),"'S","'s")
 
Upvote 0
Hi there. You have to trick the PROPER function into ignoring the apostrophe, then replacing it. Try this, which works unless any of your sentences has 'qzx' in:
=SUBSTITUTE(PROPER(SUBSTITUTE( IFERROR(VLOOKUP($C4,'MASTER PLOF'!$A:$C,2,FALSE)," ") ,"'","qzx")),"qzx","'")
 
Upvote 0
Hi there. You have to trick the PROPER function into ignoring the apostrophe, then replacing it. Try this, which works unless any of your sentences has 'qzx' in:
=SUBSTITUTE(PROPER(SUBSTITUTE( IFERROR(VLOOKUP($C4,'MASTER PLOF'!$A:$C,2,FALSE)," ") ,"'","qzx")),"qzx","'")

Thank you for your time. I have learnt something new today.
 
Upvote 0
You're welcome and thanks for the feedback. That double substitute trick can be used in a number of ways to solve other similar problems.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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