如何在Google表中计算到一周 /月的百分比?
我想计算我在 Google 表格中一周和/或当月的进度。最好的方法是什么?
理想情况下也是在单个细胞中。我还想考虑每个月的天数差异。
I want to calculate how far I am through the week and / or the current month in Google Sheets. What's the best way to do this?
Ideally in a single cell too. I also want to account for the difference in number of days from month to month.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅:
月进度:
周进度:
see:
month progress:
week progress:
demo sheet
对于每周,我通过在本周开始时使用当前的时间戳(
now()()()()
)和时间戳,然后将两者都转换为Unix Epoch时报。然后,我使用了它们之间的差异,并将一周内的秒数除以秒数(518400
),这给了我百分比的小数now now()
is整个星期。对于每月,我进行的类似于每周的方法类似,但是,为了说明不同月份的不同天数,我计算了本月末的时间戳,然后在UNIX时期计算了时间戳,然后在月初减去了时间从此开始,本月有多少秒钟。
For weekly, I did this by taking the current timestamp (
now()
) and the timestamp at the beginning of the week and converting both to unix epoch times. Then, I used the difference between them and divided both by the number of seconds in a week (518400
) and this gave me a decimal for the percent thenow()
is through the week.For monthly, I did this similarly to the weekly method but, to account for the differing number of days in different months, I calculated the timestamp at the end of the month in unix epoch time and then subtracted the time at the beginning of the month from this to work out how many seconds are in the current month.