It's to do with Pi. Give me a few minutes.
In the meantime, I reported a bug in my last post.
Here you go:
With 'd' as the number of degrees
d / 180 * PI
Or for Excel:
=MOD(D,360)*PI()/180
That way, if you get a number of degrees over 360, it compensates for it.