Ok, I got it figured out with a little help from Microsoft. For a vertical vector, Ax = 0, you can't use ATAN(Ay/Ax) to calculate the inverse tan, you have to use ATAN2(Ax, Ay) - the arguments are different. Thanks for responding.
I've found another way to go all around from -360 to 360 without using the Excel function ATAN2. Instead of ATAN2(x,y), I use ATAN(y / (sqrt(x^2+y^2) + x)) and multiply by 2 to get theta. This avoids the infinities.