#VALUE! error should return blank cell

redspanna

Well-known Member
Joined
Jul 27, 2005
Messages
1,602
Office Version
  1. 365
Platform
  1. Windows
Hi all

If B14 is blank with nothing in the cell, why does this formula return the #VALUE! error?

=IF(ISBLANK(B14),"",C14-B14)-TIME(0,30,0)

it should return a blank cell ?

TIA
 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
The first part of the formula evaluates to blank.
The second part of the formula is is subtracting given time from blank which leads to negative value.
Function Time does not support negative values, hence error.
 
Upvote 0
The first part of the formula evaluates to blank.
The second part of the formula is is subtracting given time from blank which leads to negative value.
Function Time does not support negative values, hence error.
Thanks for explaining, can you suggest an alternative formula that wouldn't return a #VALUE! error then?

Thanks
 
Upvote 0
Not sure what you're trying to do with that calculation, but if you want to "skip" calculating and return blank, just wrap your formula with IFERROR function:
Excel Formula:
=IFERROR(IF(ISBLANK(B14),"",C14-B14)-TIME(0,30,0),"")
 
Upvote 0
Or just move the paranthesis that would basically mean:
If cell is blank then return blank, else subtract C14 from B14 and subtract 30 mins:
Excel Formula:
=IF(ISBLANK(B14),"",C14-B14-TIME(0,30,0))
 
Upvote 0
Solution
Or just move the paranthesis that would basically mean:
If cell is blank then return blank, else subtract C14 from B14 and subtract 30 mins:
Excel Formula:
=IF(ISBLANK(B14),"",C14-B14-TIME(0,30,0))

Perfect - thanks a lot and have a wonderful Christmas
 
Upvote 0

Forum statistics

Threads
1,214,416
Messages
6,119,386
Members
448,891
Latest member
tpierce

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