Use ATan2, as in
ATan2(-v, -u) * (180 / 3.14159265)
The wind direction vector is assumed to be (u, v).
Because the construction in the question appears to compute the reverse direction, the direction is reversed by negating both components.
The second component of (-u, -v) is the first argument to
ATan2 (the help page does not explain this crucial point).
The result is in radians, which is converted to degrees via the multiplication.
Because this result will lie in the range (-180, 180] and the question appears to want a value in the range [0, 360), a modulus function can be used to change the range. Unfortunately, the Mod function in ArcGIS only works on integers. For full precision we need to implement the modulus ourselves using an alternative such as Int. A streamlined pair of formulas is
x = ATan2(-v, -u) / (2*3.14159265) + 1
(x - Int(x)) * 360
x represents the bearing of (-u,-v) as a fraction of a whole circle. The addition of 1 guarantees the fraction will lie between 1/2 and 3/2. The expression
x - Int(x) extracts the fractional part of that number.
For example, with u=-1 and v=1 (a direction pointing towards the northwest) we find that ATan2(-v, -u) = ATan2(-1, 1) = -0.7853982. Dividing by 2*Pi (=2*3.14159265 in single precision) yields -0.125. The addition of 1 increases that to 0.875 (of the way around the circle). The operation of subtracting its integer part leaves it unchanged at 0.875, which in degrees is 0.875 * 360 = 315. That is the direction counterclockwise relative to east. To obtain the bearing clockwise relative to north simply reverse the roles of
v in the formula.
Because adding or subtracting a half circle to any bearing reverses its direction, an equivalent but more efficient expression to use is
(ATan2(v, u) / (2*3.14159265) + 0.5) * 360
The additive constant 0.5 arises as the difference between 1 and 0.5 (the half circle). When you read this formula, think like this:
ATan2 finds the bearing of (u,v) (via
ATan2(v, u)) counterclockwise relative to East. That's converted to a fraction of the whole circle (
/ (2*3.14159264)), which is then spun around by a half-circle to reverse it and, incidentally, make the result non-negative (
+ 0.5). Finally the whole thing is converted to degrees (