Hi, this is Wayne again with a topic “The Excel TRUNC Function”.
In this Excel video, I’m going to show you how to use the trunk function to truncate data in Excel. So here I have a spreadsheet with some stats of NBA basketball players and, as you can see, the points per game and the rebounds per game are not standardized. When it comes to how many decimals are showing up in the statistics, let’s use the trunk function to fix that problem. So I’m going to click here on Cell M2.
I’Ll type equals trunk Excel. Tells me what the trunk function does it truncates a number to an integer by removing the decimal or a fractional part of the number? So after typing trunk, I’m going to put in the left parenthesis now Excel is expecting a number and I could type a number here, but it makes a lot more sense just to type in a Cell reference like L2 or if you prefer, you can use the Mouse and click on it L2 now I’ll put in the right parenthesis or not. You don’t really have to put it in there.
Sometimes I do sometimes times I don’t and then I’ll tap enter on the keyboard and you can see what happened it. Truncated 28.86. Just to be Simply 28. Now, if I select M2 and double click on the autofill handle this little green Square in the lower right corner of the cell. If I double click there Excel applies that same formula that has the trunk function in it all the way down the spreadsheet. Now the data is all standardized. Let’S try the function again, this time for rebounds, so I’m going to click on Cell O2 type equals trunk left parenthesis Excel is expecting a number this time, I’m just going to type it in N2, but this time I want to show you the last potential argument. In this formula, if you put in a comma Excel, is now expecting the number of digits. How many digits do you want to have to the right of the decimal point and it’s important to know that it’s up to that amount, so, for example, if I put 4 in here Excel, will keep up to four numbers after the decimal point.
Let’S put in the right parenthesis, tap enter and it looks like nothing changed. If I double click, though, on the autofill handle for cell O2, it extends all the way down the spreadsheet and you can see what is happening in some of these cells. There was no data beyond the first decimal point and this trunk formula that I set up allows for up to four decimal points.
So one met that criteria but notice this cell here cell n13. It had five numbers after the decimal point. Now it has only four.
That’S because of that second number in my formula, so let’s try changing it to one if I tap enter on the keyboard and then if I extend that formula all the way down the spreadsheet by double clicking on this autofill handle, you can see what happens now Up to one number to the right of the decimal point is showing up, so that’s how you can use the trunk function in Microsoft Excel thanks for watching. I hope you found this tutorial to be helpful. If you did please like follow And subscribe, and when you do click the bell and you’ll be notified when I post another video, if you’d like to support my channel, you can do that by clicking the thanks button below the video or you could support me through.
My patreon account, or by buying Channel merch and you’ll, see information about those options in the description below the video speaking of patreon. I want to give a quick shout out to my five dollar patreon supporters. Thank you. So much for all you do to support the channel. .