Wind direction with a Letter instead of Degrees?

Hi, I am not very good with the text codes used in Kustom widgets. I'm trying to turn the wind direction (right now in degrees) into more standard N, S, E, W type letters. I'm not seeing it built in, but maybe it is? Or do I need some massively complicated if/then formula?

I want to do something like this: (From excel):

=LOOKUP(MOD(A1,360),{0,22.5,45,67.5,90,112.5,135,157.5,180,202.5,225,247.5,270,292.5,315,337.5},{"N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"})

I don't think I would want 16 directions, 8 would be ideal.

Any thoughts from someone on how to do this? Thanks!

Nevermind, I think I answered my own question.

$if(wi(wdir)>337.5, N,wi(wdir)>292.5, NW,wi(wdir)>247.5, W,wi(wdir)>202.5, SW,wi(wdir)>157.5, S,wi(wdir)>112.5, SE,wi(wdir)>67.5, E,wi(wdir)>22.5, NE,N)$

Yep :) Nothing to add!