The function "and" is only for matrix arguments look it up in the help. You have to use the "and operator" ^ as Cornel had shown
There is a unit mismatch! You can only calculate f-l if both are of the same dimension. So either both must be unit-less (like f is) or both must be lengths (like l is). Choose d:=20m in Cornels sheet to see the error. I guess that f should be a length.
Another unit mismatch at the return values. Sometimes a unit-less value like f or 3.5 is returned, sometimes a length. Guess it should be 3.5 m or even better, write l, not 3.5
It would look much clearer if you use the programmed "if" statement and not the Excel-like if-function
You also may consider turning k.s into a function of d.
And here is what I get when I evaluate and plot that function in the range from -2m to 30 m:
Look a bit strange to me. Are you sure that it should look like that? Maybe the expression for d>0.7*L.rule should be, so it would rather look like