I have a a spreadsheet where I am calculating elapsed time of calls. I have one cell called Service avaiable date and time, cell AX, and another called IM Engaged date and time, cell AR. Here are the scenarios I can run into:

Scenario #1
Service availble date, AX, can be null. In this case the result should be 0:00:00

Scenario #2
IM Engaged date,cell AR, 07/16/2014 18:04 is greater then the service availble date, cell AX, 07/16/2014 17:35. Result should be 0:00:00

Scenario #3
Service availble date,cell AX, is greater, 07/16/2014 18:04 then IM Enaged date,cell AR, 07/16/2014 17:35. Result should be 0:29:00.

I tried a nested if formula, =IF(AX283="",0,IF(AR283>AX283,0,AX283-AR283) with no success. What am I missing here?

I've seen cases where empty cells are not "" so that could be your problem here. One way to solve that is to append "" in the test:

=IF(AX283 & ""="", ...

or you could try ISBLANK:

=IF(ISBLANK(AX283), ...

0

Rrave26Author Commented:

Ok, here is my formula: =IF(ISBLANK(AX276),0,IF(AR276>AX276,0,AX276-AR276)). Tried that and I get an Value error message. Cell AX is null so I should get a value of 0 correct?

The answer to whether one value is greater than another is true/false, will depend to a large extent on the data in the cell. Is the data in your AR/AX cells formatted as date/time values or are they formatted as text values?

If they are formatted as text, you might be determining greater than or less than in terms of alphabetical order, rather than date/time order.

In addition if the cells are formatted as text... when you subtract the values... that will result in an error.

0

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

This line would indicate that both cells do not contain values that excel recognizes as a date/time field.

Can you post back the results for these formulas? -- trying to figure which cell or cells do not contain dates (at least which ones Excel not recognize as dates).

Try this: (just changing the first If statement test to AX276=""

=IF(AX276="",0,IF(AR276>AX276,0,AX276-AR276))

The problem is... AX276 is not blank, because it contains a formula. --- Even though the result of the formula is a blank.

Using the above format, you are specifically checking to see if a result of the formula is blank, rather than the cell being blank. (slightly different nuance).

Note... this looks very close to the formula in your original post that you already tried... only difference I can see, is that you were missing a trailing parenthesis.

0

Rrave26Author Commented:

This fixed my issue. Thanks for the help.

0

Featured Post

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

=IF(AX283 & ""="", ...

or you could try ISBLANK:

=IF(ISBLANK(AX283), ...