Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
572 views
in Technique[技术] by (71.8m points)

time - Google表格的公式可以计算时间戳中24小时的剩余时间?(Formula of Google Sheet to compute the rest of 24 hour duration from a timestamp?)

In the cell A2 , there is the timestamp, say 21:35, I'd like to calculate the remaining time to midnight.

(在单元格A2 ,有一个时间戳记,例如21:35,我想计算到午夜的剩余时间。)

It's essentially, 24 hours minus 21:35.

(基本上是24小时减去21:35。)

But I want to have a formula for the calculation.

(但我想有一个计算公式。)

I found that if I put 24:00 in a cell, B1 , then the formula below works: =B1-A2 but I'd like to have a formula without reference to another cell for the 24:00 constant?

(我发现,如果我将24:00放在一个单元格B1 ,则下面的公式起作用: =B1-A2但我想拥有一个公式,而不引用24:00常数的另一个单元格?)

I guess there might be a way to express the constant of 24:00 as the duration in formula?

(我猜可能有一种方法可以将24:00的常数表示为公式中的持续时间?)

  ask by Yu Shen translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

try simply:

(简单尝试:)

="24:00:00"-A1

0


for ArrayFormula try:

(对于ArrayFormula,请尝试:)

=ARRAYFORMULA(IF(A1:A; TEXT("24:00:00"-A1:A; "hh:mm"); ))

0


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...