You get a -42 thousandsomething number because a blank date defaults to the oldest past date SharePoint can represent, which is 31-21-1899 (or 1900?)
So like the others answered you have to test for a blank value with:
=IF( ISBLANK([Action Closed]) , "Action not closed" , [Action Closed]-[Action Assigned] )
The MSDN reference is not always correct, see the SharePoint Functions and Syntax List I recently compiled.
If you are editting Calculated Formulas my CalcMaster Bookmarklet is of great help also, as it gives you immediate feedback while editting.
Update
Susanne, its easier to use a plain text editor when writing Formulas, then paste them in SharePoint. SharePoint will ignore all new lines so you can copy/paste Formulas like":
=IF( ISBLANK( [Action Closed] )
, "Action not closed!!"
, IF( ISBLANK( [Action Assigned] )
, "Action Closed but not assigned!!"
, "Action took:" & [Action Closed]-[Action Assigned] & " days"
)
)
This shows how you can nest functions, but you have to be very precise with all commas and brackets!
The CalcMaster Bookmarklet I made public would really help you out, but you may have to ask a SharePoint power-user to help you install it.
Another tip is to built them in Excel, as you get immediate results in an Excel sheet. Just be aware not all Excel functions work in SharePoint.
The above Formula can be tested in Excel. So get it right in Excel first. Replace the Column names with Excel cell references like:
=IF( ISBLANK( A1 )
, "Action not closed!!"
, IF( ISBLANK( A2 )
, "Action Closed but not assigned!!"
, A2-A1
)
)
If you don't know how to write Excel functions, then learn them first. Plenty of online courses around.
SharePoint (Formulas) is like learning to ride a bicycle without side-wheels, but its worth taking some falls, getting up and persevering.
And learn the Markup to use on StackOverflow
Well formatted and detailed questions get you better answers. And marking answers as Answer also gain you more credit.