Basic Excel Function - How to use TRIM Function


Today we will be learning the TRIM Function. The function removes all spaces from a text string except single spaces between words. In today’s example, we will also show you how to remove the spaces between words. We will be using WHO COVID-19 Vaccine For Emergency Use: Oxford – AstraZeneca, Sinopharm – BBIBP, Pfizer – BioNTech, Moderna, Sinovac and Janssen as example.


We will also show you how to convert your TRIM function into an API at the end of the video.


Download: AlchemyJ FREE Community Edition: https://www.alchemyj.io/download


Template: https://www.alchemyj.io/aj-excel-template


Learn More:

How to setup AlchemyJ: https://www.youtube.com/watch?v=eTyYTf1sw9k&feature=youtu.be&ab_channel=AlchemyJ

​​ ​

How AlchemyJ works: https://www.youtube.com/watch?v=bAQHo8I1xuQ&ab_channel=AlchemyJ


Let's connect: LinkedIn: https://www.linkedin.com/company/alchemyj/


Article


Today we will be learning the TRIM Function. The function removes all spaces from a text string except single spaces between words. In today’s example, we will also show you how to remove the spaces between words. Without further ado, let us get started.


How to use TRIM Function


In our excel spreadsheet, we will see a list of WHO COVID-19 Vaccine For Emergency Use. Oxford – AstraZeneca, Sinopharm – BBIBP, Pfizer – BioNTech, Moderna, Sinovac and Janssen. However, the excel file is corrupted with unnecessary blanks before, in-between and after each vaccine. Let us clean it up with Trim Function.


We will remove the blank spaces. Select Cell C4, type in equal, TRIM, open parentheses. Select Cell B4 and hit return. You will get Oxford – AstraZeneca without any blank spaces. Now, let’s do a quick auto-fill to Trim the other vaccines. It looks a lot neater now.


Next, we will learn how to remove the blank spaces between words. It will be slightly complicated than the previous example. Select Cell D4, type in equal, TRIM, open parentheses. Type SUBSTITUTE and open parentheses. Select B4, comma and space. Open quote, space and close quote. The space in-between quotes represent the spaces between the words. Next, we will omit the space. Comma, space, open and close quotes. Double close parentheses and hit return. We will get Oxford–AstraZeneca. without any spaces between words. Lastly, let us auto-fill the same function to the rest of the vaccines.


Intermission


There you have it, the TRIM function for Excel. If you have any excel formula you want us to teach, let us know in the comment section below. Don't forget to subscribe, hit the bell button and turn on the notification to have more free excel function tutorials. But, before you go, we have a bonus clip for you. I will be turning this Excel spreadsheet into an API. Stay tuned to see how the magic works.


Convert TRIM Function into Application Programming Interface (API)


I will be using AlchemyJ Studio Excel Add-in to turn this TRIM function Excel into an API. To do this, I will need AlchemyJ Excel installed and with a pre-set of rules. I will select AlchemyJ Tab, select Generate API and click on Generate API. The file is now converting. Okay, your API is ready.


I will now launch this open API that AlchemyJ generates. I will expand this tab and select try it out. I will input Pfizer–BioNTech with random blank spaces and select Execute. Let us check if our TRIM function can remove the empty spaces. Awesome, All spaces are removed.


Closing


AlchemyJ Studio Excel Add-in turns your Excel business model into API. This way, you can integrate your Excel model into other applications. You can download AlchemyJ Studio Excel Add-in for free at alchemyj.io. And once again, thank you for watching. So which Excel function you wish to be converted into an API? Let us know in the comment section below. Lastly, don't forget to subscribe, hit the bell button and turn on the notification. See you soon.

40 views