floor向下取整
Earlier this week, you read about the Top 100 Canadian Singles, and saw the pivot table that summarized the top songs by decade.
本周初,您了解了加拿大单曲前100名 ,并看到了数据透视表,该数据表按十年总结了热门歌曲。
In the comments, Martin mentioned the FLOOR function, that I used to calculate each song's decade, based on its release year.
在评论中,马丁提到了FLOOR函数,我根据它的发行年份来计算每首歌的十年。
Martin also pointed out that the files weren't downloading, and I finally managed to fix that -- sorry about the inconvenience.
马丁还指出,这些文件没有下载,我终于设法解决了这一点-不便之处,敬请原谅。
Take my advice, and don't work on your blog while travelling, if you can avoid it! Things that work perfectly at home, refuse to cooperate when you're on the road.
采纳我的建议,如果可以避免,请勿在旅行时在博客上工作! 在家中可以正常工作的事物,在旅途中拒绝合作。
地板 (FLOOR It)
The Excel FLOOR function rounds numbers down, toward zero, based on the multiple of significance that you specify. In the Canadian Music file, the decade is being calculated, so 10 is used as the multiple.
Excel FLOOR函数根据您指定的有效倍数将数字向下舍入为零。 在加拿大音乐文件中,正在计算十年,因此将10用作倍数。
=FLOOR(A2,10)
=地板(A2,10)
![FloorFunction01 FloorFunction01](https://i-blog.csdnimg.cn/blog_migrate/7c4c1e0d4572d599b4ad6e43b5323ca8.png)
In column B, you can see the result of the FLOOR function, rounding down the year for each song, to show the song's decade.
在B列中,您可以看到FLOOR函数的结果,四舍五入每一首歌曲的年份,以显示歌曲的十年。
地板故障 (Trouble on the FLOOR)
In the FLOOR function, if the number and multiple have different signs, the result is the #NUM! error. The FLOOR function works well in the music example, because the song's year is always a positive number.
在FLOOR函数中,如果数字和多个具有不同的符号,则结果为#NUM! 错误。 FLOOR函数在音乐示例中效果很好,因为歌曲的年份始终为正数。
If you're working with a list that contains both positive and negative numbers, you could use the SIGN function to calculate the number's sign, and change the multiple to match it.
如果要使用包含正数和负数的列表,则可以使用SIGN函数计算数字的符号,并更改倍数以使其匹配。
=FLOOR(A2,SIGN(A2)*10)
=地板(A2,SIGN(A2)* 10)
![FloorFunction02 FloorFunction02](https://i-blog.csdnimg.cn/blog_migrate/b0ec6ef9c8f928e1dd11daf9420bcb76.png)
The SIGN function result is 1 for positive number, -1 for negative numbers, and 0 for zero.
SIGN函数的结果是:正数为1,负数为-1,零为0。
金子般的心 (Heart of Gold)
And finally, for your Friday listening pleasure, here is the second song on the Top 100 Canadian Singles list -- Neil Young playing Heart of Gold.
最后,为您在星期五的聆听乐趣,以下是加拿大单打前100名名单中的第二首歌-尼尔·扬(Neil Young)演奏《黄金之心》。
翻译自: https://contexturesblog.com/archives/2010/10/08/fix-the-floor-to-round-down-in-excel/
floor向下取整