When you the formula returns a "" and you add 1, it returns an error as "" is text
Try
Code:
=IF(OR(A1="",B1=""),"",B1-A1+1)
For reasons unknown cell A4 is not empty but it contains a space " " which again returns an error as ""is not the same as " " ( a cell with a space is not empty)
I suppose this is a mistake??