TRIM function of Excel and Text.Trim functions of Power Query both remove leading and trailing spaces (ASCII Char code 32) from a text.
But Excel's TRIM goes a step further. If there are mulitiple spaces between words, it will reduce those to a single space between words.
Hence if I have a string " Microsoft Power Query "
Text.Trim will give the output of "Microsoft Power Query" whereas Excel's TRIM will give the output "Microsoft Power Query".
Let's create a fomula in Power Query's M Language which gives the result equivalent to Excel's Trim function
Excel file used in this video can be downloaded from – https://1drv.ms/x/s!Akd5y6ruJhvhvg3WVGhECajF1Coj?e=sIYidG