How do I stop a formula if the cell is blank?

柔情痞子 提交于 2021-02-05 09:32:15

问题


How do I stop a formula from running if there is no data in the cell to the left?

I'm trying to work out how to display elapsed time using a fixed time and a dynamic clock.

My fixed time is in Cell D5 and my dynamic clock in Cell J4 (picture attached). To work out 'elapsed time' my forumla is as follows; =J4-D5, which works fine. However, when I copy the forumla down if there is no data in cells D6,D8,D9 etc, then it will just display the current time.

Is there some error checking that I can do that will only run the forumla if there is data present in Column D?

I am very new to excel, so apologies for the noob question.

Many thanks


回答1:


If(D5 = "","",J4-D5)

Explanation: IF D5 = "empty String" THEN "empty string". Else J4-D5.



来源:https://stackoverflow.com/questions/37143261/how-do-i-stop-a-formula-if-the-cell-is-blank

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!