+ Reply to Thread
Results 1 to 6 of 6

IF Function to assign Compass Quadrants to Values

  1. #1
    Registered User
    Join Date
    10-11-2013
    Location
    Perth
    MS-Off Ver
    Excel 2013
    Posts
    3

    IF Function to assign Compass Quadrants to Values

    Hi there,

    I'm trying to write a formula to express measured values as compass quadrants using the IF Function. I've managed to express the first two although I can't get the function to express any more than two. So far I've got:

    =IF(AND(J2>22.5,J2<67.5),("NE"),IF(AND(J2>67.5,J2<112.5),("E")))

    This returns any values between 22.5 to 67.5 as NE, between 67.5 - 112.5 as E and and all others as FALSE. Adding any further parameters ruins the formula. Is there a maximum number of values you can express using the IF and AND formulas, or is there another way or creating this formula?

    There parameters I would like to set are

    22.5 - 67.5 = NE
    67.5 - 112.5 = E
    112.5 - 157.5 = SE
    157.5 - 202.5 = S
    202.5 - 247.5 = SW
    247.5 - 292.5 = W
    292.5 - 337.5 = NW
    337.5 - 22.5 = N

    Any help would be much appreciated.

    Iain

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,067

    Re: IF Function to assign Compass Quadrants to Values

    Hi iainl,

    I found that removing the brackets around the result you want allows you to have the extra If And .. clauses.

    Please Login or Register  to view this content.
    The last statement will not work though as it states If the cell value is >337.5 and <22.5 ... which won't work.

    You'll need to rework that parameter.

    In general, Excel will only allow a total of 7 Nested statements.

    Hth
    Remember you are unique, like everyone else

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,164

    Re: IF Function to assign Compass Quadrants to Values

    Hi Iain and welcome to the forum,

    I think you need a VLookup formula where the range value is TRUE. See my example attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  4. #4
    Registered User
    Join Date
    10-11-2013
    Location
    Perth
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: IF Function to assign Compass Quadrants to Values

    Cheers, noboffinme that's awesome! For the work around I set two parameters, one equalling 337.5 - 360 then another from 0 - 22.5.

    Thanks a lot!

  5. #5
    Registered User
    Join Date
    10-11-2013
    Location
    Perth
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: IF Function to assign Compass Quadrants to Values

    Thats really useful too Marvin, thanks a lot for the help.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: IF Function to assign Compass Quadrants to Values

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to create a compass rose graph
    By maschette in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 09-08-2012, 06:16 AM
  2. Replies: 8
    Last Post: 09-06-2012, 01:50 PM
  3. Replies: 11
    Last Post: 08-22-2011, 12:40 PM
  4. compass heading calculation
    By jaypee in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-05-2007, 11:06 AM
  5. [SOLVED] How do I set a circle to be filled in quadrants?
    By cburnham564 in forum Excel General
    Replies: 0
    Last Post: 11-17-2005, 01:35 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1