Sure, you can use the IsBlank() function to test for an empty cell. So, this should do the trick:
=If(IsBlank(A1), "Error", "OK")
There are several other Is* functions that might be useful: IsErr, IsError, IsLogical, IsEven, IsOdd, IsNA, IsNumber, IsNonText, IsText, IsRef. Depending on your version of Excel, you may need the Analysis ToolPak add-in installed to have access to some of those.