+ Reply to Thread
Results 1 to 6 of 6

IF statement for non-consecutive numbers

  1. #1
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    IF statement for non-consecutive numbers

    I'm looking to use an IF statement to classify a range of numbers within 6 categories, however the numbers belonging to each category are not consecutive, thus:
    Lowest = 1, 7, 13, 19
    Low = 2, 8. 14. 20
    Medium = 3, 9, 15, 21
    High = 4, 10, 16, 21
    And so on.

    The problem is I have 100 cases and using an IF statement to check for all 24 numbers is a bit much (and I think is too many arguments?). I already use IF to sum up the total belonging in each category but I also want to check if an individual changes category over time and therefore need to classify each person separately.

    Is there a simpler formula to check all the numbers in one go?

  2. #2
    Forum Contributor
    Join Date
    02-07-2013
    Location
    Karachi, Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    290

    Re: IF statement for non-consecutive numbers

    Hi Sinnie,

    Post a sample with expected result...

    Regards,

  3. #3
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: IF statement for non-consecutive numbers

    So the score in column A is the variable.
    The grouping (B) is organised in numerical order, i.e. 1-5 = home, so is easy to categorise using IF.
    The categories (C) exist within each grouping, so each grouping has each of the categories, thus I would like the IF statement to put A for a score of 1, 5 and 8.

    If that makes sense?

    Right now I'm doing separate columns for all 6 categories, but I have to do it twice, so it takes up a lot of space. Unless there is a simpler method of doing it, then I'll just keep it this way.
    Attached Files Attached Files
    Last edited by Sinnie; 02-12-2016 at 08:29 AM.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF statement for non-consecutive numbers

    Create a 2 column table with the score in the left column and the corresponding category in the right column.

    Then you can use a VLOOKUP function:

    Data Range
    A
    B
    C
    D
    E
    F
    1
    Score
    Grouping
    Category
    Score
    Category
    2
    1
    Home
    A
    1
    A
    3
    3
    Home
    C
    2
    B
    4
    5
    Work
    A
    3
    C
    5
    7
    Work
    C
    4
    B
    6
    3
    Home
    C
    5
    A
    7
    2
    Home
    B
    6
    B
    8
    9
    Work
    E
    7
    C
    9
    6
    Work
    B
    8
    A
    10
    12
    Misc
    E
    9
    E
    11
    11
    Misc
    D
    10
    C
    12
    8
    Misc
    A
    11
    D
    13
    3
    Home
    C
    12
    E
    14
    2
    Home
    B
    15
    1
    Home
    A
    ------
    ------
    ------


    This formula entered in B2 and copied down:

    =VLOOKUP(A2,E$2:F$13,2,0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    01-15-2013
    Location
    UK
    MS-Off Ver
    Excel 2003
    Posts
    53

    Re: IF statement for non-consecutive numbers

    Thanks very much!

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF statement for non-consecutive numbers

    You're welcome!

+ 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. Consecutive numbers
    By newx in forum Excel General
    Replies: 8
    Last Post: 09-08-2015, 09:04 PM
  2. Finding 5 consecutive numbers in a set of 7 numbers
    By Namejs in forum Excel General
    Replies: 13
    Last Post: 05-20-2015, 06:35 AM
  3. How to get MIN and MAX of Consecutive Numbers
    By Livmi in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-12-2015, 02:04 PM
  4. Replies: 6
    Last Post: 03-23-2012, 06:03 PM
  5. Sum Non-consecutive Numbers
    By dschwister in forum Excel General
    Replies: 12
    Last Post: 10-13-2011, 06:08 PM
  6. Excel macro to "fill in" consecutive numbers in non-consecutive list?
    By Tomkat in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-03-2009, 01:13 PM
  7. [SOLVED] consecutive numbers
    By Monique in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-07-2005, 02:06 AM

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