View Single Post
  #3   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Tue, 8 Mar 2005 01:43:03 -0800, "John T. Sheedy" <John T.
wrote:

I have a list of numbers 0-35 that I have to convert to 8 compass
directions(N, NW, E, ECT.). I used the IF function to search but the string
doesnt work. I tried using an array {1,2,3,33,34,35} for north and it comes
back as false even thought the search number is 35

This is a sample of the finction I am using

=IF(A5={0,1,2,33,34,35},"N",IF(A5={3,4,5,6,},"NE" ,"NW"))
I carries this formula out to the 7 argument limet and am using the NW to
represent the last compass direction.

Please help

John


Assuming, if I may, that the numbers you are using refer to the compass
direction in degrees divided by 10, then I believe your example is incorrect.

Shouldn't 33 equate to NW? NW = 315° so the dividing point between NW and N
should be at 315° + 22.5° or 337.5° or, in your "divide by 10" 33.75?

If that is the case, then the following formula should give you your desired
results (with your "number" in A1)

=HLOOKUP(A1,{0,2.25,6.75,11.25,15.75,20.25,24.75,2 9.25,33.75;"N","NE","E","SE","S","SW","W","NW","N" },2)

You may want to add an IF test to ensure a valid entry; or use data validation
to ensure the same.


--ron