IF and ISNA trouble

piguy

New Member
Joined
Aug 26, 2011
Messages
32
Not sure what I'm doing wrong. Tried a couple of things but cannot get to work. Trying to remove "######" from cell when time is left blank.

here is formula:

=IF(ISNA(F6-TIME(1,0,0)),"test",(F6-TIME(1,0,0)))

if there is no time entered in cell F6, I'd like it to say "test"
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
The ###### error actually means your column isn't wide enough, it's not an error with the value so you can't test for it.

Try
=IF(F6="", "Test", F6-TIME(1,0,0))

Regards
Adam
 
Upvote 0
The ###### error actually means your column isn't wide enough, it's not an error with the value so you can't test for it.

Not so much that the column isn't wide enough..

It's that a blank cell Minus an hour is a Negative Time.
And Excel can't format a negative time, so it displays #########
It won't matter how wide you make the column.

But you're right that it's not technically an error..
It's just that it can't apply a time format to it because there's no such thing as negative time to Excel.
 
Upvote 0
Not so much that the column isn't wide enough..

It's that a blank cell Minus an hour is a Negative Time.
And Excel can't format a negative time, so it displays #########
It won't matter how wide you make the column.

But you're right that it's not technically an error..
It's just that it can't apply a time format to it because there's no such thing as negative time to Excel.

Nice clarfication, thanks. I'd never thought of it in that way before.

Regards
Adam
 
Upvote 0
Another interesting part to this is that the underlying value is still there.
Again, excel just can't apply a time format to it.

So even with a cell holding a negative time, and displaying ####
You can still do math on it.
Add say 2 hours to it, and you will have the correct result.
 
Last edited:
Upvote 0
That is interesting because it struggles with some other numbers that exist but can't be displayed - SQRT(-1) is the obvious example - and it just errors out and won't let you work with it.
 
Upvote 0
That is interesting because it struggles with some other numbers that exist but can't be displayed - SQRT(-1) is the obvious example - and it just errors out and won't let you work with it.

So what is the square root of -1 ?


The difference here is that the function sqrt is returning an actual error.
The problem in the thread is that the subtraction function is working fine, Excel just can't format it as a time.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,917
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top