Share via

Create error message if cell is left empty

Anonymous
2017-10-04T22:49:29+00:00

I have the following formula to calculate the difference between 2 different times. =TEXT(J2-G2,"h:mm") I am calculating the minutes from the time my ED doctor makes a decision to transfer a patient until the time the patient departs from our facility. I've got that all figured out. My problem is my clerks are leaving the G2 column blank so the formula is seeing it as a zero. Is there a formula to add to the one above that will tell Excel to return an error message if G2 is left blank?

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-10-04T23:24:58+00:00

You're more than welcome! Happy we were helpful.

Ciao Ugo

Was this answer helpful?

0 comments No comments

Answer accepted by question author

Anonymous
2017-10-04T23:21:30+00:00

Just swap your formula with mine and see if it works.

Let us know the outcome please :-D

Was this answer helpful?

0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2017-10-04T23:23:30+00:00

    You are brilliant!!!! Thank you!

    Was this answer helpful?

    0 comments No comments
  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2017-10-04T22:52:16+00:00

    Ciao,

    please try the following:

    =IF(G2,TEXT(J2-G2,"h:mm"),"PLEASE FILL CELL G2")

    Please let us know if this helps somehow.

    Ciao Ugo

    Was this answer helpful?

    0 comments No comments