EXCEL FUNCTIONS-TRIM

INTRODUCTION

TRIM function comes under the TEXT category in Excel.

Think of a scenario where you copy some text from one place to another or you are editing some long text where the spaces between any two words are random, how awkward would it look.

In big reports its not easy to proof read the text or data over and again in short period of time. That’s why many functions are provided in excel which looks simple but are very useful while handling large sized reports.

One of these function is TRIM FUNCTION which we are going to discuss here.

TRIM FUNCTION REMOVES THE EXTRA SPACES BETWEEN TWO WORDS AND LEAVES ONLY ONE STANDARD SPACE AND NO SPACE BEFORE THE FIRST WORD AND AFTER THE LAST WORD.

By this , we can apply this function to very large text and this function ensures that there are no random spaces left.

e.g.

 HELLO    THERE! HOW  ARE YOU     DOING??

So this text looks bad when we look at it. There can be multiple reasons why the text is like that. So for the same we have TRIM function.

PURPOSE OF TRIM FUNCTION IN EXCEL

https://googleads.g.doubleclick.net/pagead/ads?us_privacy=1—&client=ca-pub-3894096195292173&output=html&h=280&adk=2830363141&adf=3607279428&pi=t.aa~a.1618001517~rp.1&w=996&fwrn=4&fwrnh=100&lmt=1617991197&rafmt=1&to=qs&pwprc=2196269336&psa=1&format=996×280&url=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2Ffunctions%2Fexcel-text-functions%2Fexcel-function-trim%2F%23gsc.tab%3D0&flash=0&fwr=0&pra=3&rpe=1&resp_fmts=3&wgl=1&fa=40&dt=1617991196825&bpp=5&bdt=3761&idt=-M&shv=r20210406&cbv=r20190131&ptt=9&saldr=aa&abxe=1&cookie=ID%3Db41a5cb189e66f3a-22460afed7c40041%3AT%3D1605880192%3ART%3D1605880192%3AR%3AS%3DALNI_MYRs0eKq0LSuIv_AMQC2BxdrJqY6g&prev_fmts=0x0%2C255x600&nras=2&correlator=6708800844877&frm=20&pv=1&ga_vid=117138297.1592477652&ga_sid=1617991196&ga_hid=1438757605&ga_fc=0&u_tz=330&u_his=1&u_java=0&u_h=936&u_w=1664&u_ah=895&u_aw=1664&u_cd=24&u_nplug=0&u_nmime=0&adx=356&ady=1443&biw=1648&bih=765&scr_x=0&scr_y=0&eid=42530672%2C44740079%2C44739387&oid=3&pvsid=1371831901264011&pem=612&ref=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2F&eae=0&fc=1920&brdim=-8%2C-8%2C-8%2C-8%2C1664%2C0%2C1691%2C917%2C1664%2C765&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=31&ifi=3&uci=a!3&btvi=1&fsb=1&xpc=CJaRsL56oa&p=https%3A//gyankosh.net&dtd=284

TRIM FUNCTION removes the extra spaces in the given text and keeps only one standard space.
https://googleads.g.doubleclick.net/pagead/ads?us_privacy=1—&client=ca-pub-3894096195292173&output=html&h=280&adk=320497122&adf=3132745106&pi=t.aa~a.131391915~rp.4&w=480&fwrn=4&fwrnh=100&lmt=1617991197&rafmt=1&to=qs&pwprc=2196269336&psa=1&format=480×280&url=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2Ffunctions%2Fexcel-text-functions%2Fexcel-function-trim%2F%23gsc.tab%3D0&flash=0&fwr=0&pra=3&rpe=1&resp_fmts=3&wgl=1&fa=40&dt=1617991196825&bpp=4&bdt=3762&idt=-M&shv=r20210406&cbv=r20190131&ptt=9&saldr=aa&abxe=1&cookie=ID%3Db41a5cb189e66f3a-22460afed7c40041%3AT%3D1605880192%3ART%3D1605880192%3AR%3AS%3DALNI_MYRs0eKq0LSuIv_AMQC2BxdrJqY6g&prev_fmts=0x0%2C255x600%2C996x280&nras=3&correlator=6708800844877&frm=20&pv=1&ga_vid=117138297.1592477652&ga_sid=1617991196&ga_hid=1438757605&ga_fc=0&u_tz=330&u_his=1&u_java=0&u_h=936&u_w=1664&u_ah=895&u_aw=1664&u_cd=24&u_nplug=0&u_nmime=0&adx=854&ady=1748&biw=1648&bih=765&scr_x=0&scr_y=0&eid=42530672%2C44740079%2C44739387&oid=3&pvsid=1371831901264011&pem=612&ref=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2F&eae=0&fc=1920&brdim=-8%2C-8%2C-8%2C-8%2C1664%2C0%2C1691%2C917%2C1664%2C765&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=31&ifi=4&uci=a!4&btvi=2&fsb=1&xpc=lbpPINEC2S&p=https%3A//gyankosh.net&dtd=303

PREREQUISITES TO LEARN TRIM FUNCTION

https://googleads.g.doubleclick.net/pagead/ads?us_privacy=1—&client=ca-pub-3894096195292173&output=html&h=280&adk=2830363141&adf=2077689065&pi=t.aa~a.1177883107~rp.1&w=996&fwrn=4&fwrnh=100&lmt=1617991197&rafmt=1&to=qs&pwprc=2196269336&psa=1&format=996×280&url=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2Ffunctions%2Fexcel-text-functions%2Fexcel-function-trim%2F%23gsc.tab%3D0&flash=0&fwr=0&pra=3&rpe=1&resp_fmts=3&wgl=1&fa=40&dt=1617991196825&bpp=4&bdt=3761&idt=-M&shv=r20210406&cbv=r20190131&ptt=9&saldr=aa&abxe=1&cookie=ID%3Db41a5cb189e66f3a-22460afed7c40041%3AT%3D1605880192%3ART%3D1605880192%3AR%3AS%3DALNI_MYRs0eKq0LSuIv_AMQC2BxdrJqY6g&prev_fmts=0x0%2C255x600%2C996x280%2C480x280&nras=4&correlator=6708800844877&frm=20&pv=1&ga_vid=117138297.1592477652&ga_sid=1617991196&ga_hid=1438757605&ga_fc=0&u_tz=330&u_his=1&u_java=0&u_h=936&u_w=1664&u_ah=895&u_aw=1664&u_cd=24&u_nplug=0&u_nmime=0&adx=356&ady=2283&biw=1648&bih=765&scr_x=0&scr_y=0&eid=42530672%2C44740079%2C44739387&oid=3&pvsid=1371831901264011&pem=612&ref=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2F&eae=0&fc=1920&brdim=-8%2C-8%2C-8%2C-8%2C1664%2C0%2C1691%2C917%2C1664%2C765&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=31&ifi=5&uci=a!5&btvi=3&fsb=1&xpc=bBjuaF0esu&p=https%3A//gyankosh.net&dtd=318

THERE ARE A FEW PREREQUISITES WHICH WILL ENABLE YOU TO UNDERSTAND THIS FUNCTION IN A BETTER WAY.

  •  Basic understanding of how to use a formula or function.
  •  Basic understanding of rows and columns in Excel.
  • Some information about the financial terms is an advantage for the use of such formulas.
  •  Of course, Excel software.

Helpful links for the prerequisites mentioned aboveWhat Excel does? How to use formula in Excel?https://googleads.g.doubleclick.net/pagead/ads?us_privacy=1—&client=ca-pub-3894096195292173&output=html&h=250&adk=2235852536&adf=549200943&pi=t.aa~a.2466988802~rp.4&w=470&fwrn=4&fwrnh=100&lmt=1617991197&rafmt=1&to=qs&pwprc=2196269336&psa=1&format=470×250&url=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2Ffunctions%2Fexcel-text-functions%2Fexcel-function-trim%2F%23gsc.tab%3D0&flash=0&fwr=0&pra=3&rpe=1&resp_fmts=3&wgl=1&fa=40&dt=1617991196825&bpp=5&bdt=3762&idt=5&shv=r20210406&cbv=r20190131&ptt=9&saldr=aa&abxe=1&cookie=ID%3Db41a5cb189e66f3a-22460afed7c40041%3AT%3D1605880192%3ART%3D1605880192%3AR%3AS%3DALNI_MYRs0eKq0LSuIv_AMQC2BxdrJqY6g&prev_fmts=0x0%2C255x600%2C996x280%2C480x280%2C996x280&nras=5&correlator=6708800844877&frm=20&pv=1&ga_vid=117138297.1592477652&ga_sid=1617991196&ga_hid=1438757605&ga_fc=0&u_tz=330&u_his=1&u_java=0&u_h=936&u_w=1664&u_ah=895&u_aw=1664&u_cd=24&u_nplug=0&u_nmime=0&adx=854&ady=2598&biw=1648&bih=765&scr_x=0&scr_y=0&eid=42530672%2C44740079%2C44739387&oid=3&pvsid=1371831901264011&pem=612&ref=https%3A%2F%2Fgyankosh.net%2Fmsexcel%2F&eae=0&fc=1920&brdim=-8%2C-8%2C-8%2C-8%2C1664%2C0%2C1691%2C917%2C1664%2C765&vis=1&rsz=%7C%7Cs%7C&abl=NS&fu=128&bc=31&ifi=6&uci=a!6&btvi=4&fsb=1&xpc=zm7ck0eLkM&p=https%3A//gyankosh.net&dtd=333

SYNTAX: TRIM FUNCTION

The Syntax for the function is

=TRIM(TEXT STRING)

TEXT STRING   GIVEN TEXT

EXAMPLE:TRIM FUNCTION IN EXCEL

DATA SAMPLE

Here we take an example to show how the Trim Function works.

Let us take the same line from the introduction and try our latest learnt function i.e. Trim Function in Microsoft Excel.

HELLO    THERE! HOW  ARE YOU     DOING??

EXCEL FUNCTION TRIM
EXCEL:TRIM FUNCTION ANIMATED EXAMPLE

STEPS TO USE TRIM FUNCTION

The text having random spaces has been taken for the example.

We can see that there are some irregular spacing in the line. So we will use the function TRIM to remove those spaces.

The formula used is

=TRIM(D9)

The text is stored in D9 which needs to be corrected. The output is shown in E9.