The problem is not the READEXEL command but the format/content of the "empty" cells in the Excel file itself. It looks like those cells are not really empty but contain a null string which is exactly what you also see in the Mathcad matrices (and which are responsible for the error as you can't do mah calculations with strings).
You may give it a try. Doubleclick in Excel into one of the empty cells and press the backspace key. This deletes the content of the cell. Now save the Excel file and let your Mathcad sheet run. You will notice that this specific cell now has a NAN as you expected.
One easy workaround is to use in your function "fun" instead of
if file]i,1 /= NaN
(which does not work that way anyway, you would have to use the negation of IsNaN(file[i,1) )
if file]i,1 = ""
That way no attempt is made to do calculations with strings and the function works.
But ... for every line with an empty string x and y are now 0 (because you don't assign a value). I guess its better to either really skip those lines or at least put NaNs into x,y (which is what I did in the attached sheet.
Other workarounds are to write a function which replaces all empty strings by NaNs in a matrix.
You may use "Match" followed by "trim" to delete all rows of a matrix which contain an empty string.
If you don't like the NaN' in the result of your function "fun" (they interrupt the plotted graph) you may use "filterNaN" to get rid of them (see attached sheet).