logologo
Dream Big Reach Far
  • 🦁 Home
  • #️⃣ FirstTimeWe
  • 🤔 Blog
  • 👋 Contact
  • #StandwithUkraine ↗
Previous Post
Next Post

Blog » Digital » Upper Case in Google Sheets Using Formulas and JavaScript

Upper Case in Google Sheets Using Formula or JavaScript
Nov 30
LoveinLions Digital 2 comments tags: google sheets, javascript, upper case

Upper Case in Google Sheets Using Formulas and JavaScript

Just recently I ran into the need of applying upper case in Google Sheets – I needed to capitalise the content that was initially written in sentence case. I spent some time looking for the solution and stopped at something that worked great for me.

Click here to scroll down to the JavaScript solution or continue reading for the formulas.

The formulas are also helpful if you need to change your text to lower case or sentence case. So, if you are in that place that I was an hour ago, then let’s go ‘back to the future’ with me.

Here is the formula for modifying text to upper case in Google Sheets:

=UPPER(A1)

…where =UPPER() is the actual formula that does the trick and A1 is a cell with the text that you want to capitalise. Just type it out in an empty cell and you will see it copy your A1 content and change it to upper case. Done.

To change the text to lower case, try this:

=LOWER(A1)

…where =LOWER() is the formula to change your text to lower case and A1 is the cell you need to change.

And if you need to bring everything back to sentence case, try this:

=PROPER(A1)

…where =PROPER() is the formula and A1 is your target cell.

Easy, right?

The only downside of the above formulas is that you have to use them in new cells which leaves you with duplicates and the need to replace the old cells with the new ones.

Hence, here is another solution (and I do like it better).

JavaScript Solution

Try using JavaScript in the Code Editor of the Google Sheets file to automatically capitalise everything on edit. Here is how you can implement it.

In your Google Sheets, go to “Tools”, then “Script editor…” and paste the following code:

function onEdit(e) 
{
  if (typeof e.value != 'object') {
  e.range.setValue(e.value.toUpperCase());
}
}

That’s it! You don’t need to set any triggers. From now on, everything you change will be automatically capitalised.

These two simple solutions certainly helped me with what I needed to achieve so I hope it will help you, too ????

Please check out other posts in my blog. Thanks.

Share this:
2543
0
About the Author: LoveinLions
Content creators, explorers and DestinAsian competition winners - in love with everything digital. Follow us on Instagram (@LoveinLions) and subscribe to ROAR updates to stay tuned!

  • Drinking and Eating Douro
    When you think of Douro, you think of wine... But this wonderful region in the Read more
    in Dream Big Reach Far, Portugal 0 comments
    0
  • Open Keynote in PowerPoint on Windows PC
    Do you need to open Keynote in PowerPoint on Windows PC? Read more
    in Digital 0 comments
    1
  • The Beginning of Our Story
    Time to get away from techy stuff a bit and go personal. Read more
    in Dream Big Reach Far 0 comments
    0

2 Comments:

  1. Christopher
    December 17, 2017
    Reply

    Very easy to understand and follow! Thanks.

    • Vladi
      December 17, 2017
      Reply

      Glad this post was helpful. Thank you Christopher!


Leave a Comment! Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2022. All Rights Reserved. @LoveinLions | Privacy Policy | Terms & Conditions

This site wants to use cookies to provide the best browsing experience.
Learn more or adjust your settings here.

Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

3rd Party Cookies

This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

Please enable Strictly Necessary Cookies first so that we can save your preferences!

More Information

More information about our Privacy Policy, Terms & Conditions.