#NUM! means a numeric result is invalid — e.g. the square root of a negative number, an impossible iteration, or a value too large for Excel.
Check the inputs
Ensure values are valid for the operation (e.g. non-negative for SQRT).
Provide a guess
Give IRR/RATE a reasonable [guess] argument to help it converge.
The cash flows don't converge to a rate. Add a [guess] and make sure there's at least one negative and one positive value.