+ Reply to Thread
Results 1 to 3 of 3

Embedded IF statements

  1. #1
    Registered User
    Join Date
    05-04-2009
    Location
    Fall River, MA
    MS-Off Ver
    Excel 2002
    Posts
    9

    Embedded IF statements

    Ok, I'm trying to do something for a pool league, and I think I know what my problem is, but I was hoping if someone had a work around.

    First, a quick description:

    In 9-ball, people have different handicaps. These range from 1-9. Depending on what your handicap is, you must pocket a certain number of balls to win.

    Using an example I normally have to deal with, someone with a handicap of 4 must pocket 31 balls. If you do that, you win and get the lionshare of the points assigned for the match (which is some value where the sum of both scores is equal to 20). Now, if my opponent is the same handicap as I am, then it goes to the amount of balls he has pocked at the time I hit my cap of 31.

    Here's the breakdown:

    Opponent pockets 0 - 5 balls, 20-0
    Opponent pockets 6 - 8 balls, 19-1
    Opponent pockets 9 - 11 balls, 18-2
    Opponent pockets 12 - 14 balls, 17-3
    Opponent pockets 15 - 18 balls, 16-4
    Opponent pockets 19 - 21 balls, 15-5
    Opponent pockets 22 - 24 balls, 14-6
    Opponent pockets 25 - 27 balls, 13-7
    Opponent pockets 28 - 30 balls, 12-8

    I was using embedded if statements saying if the score is in the range of 0-5, then show "20-0", else if the score is in the range of 6-8, then show 19-1, else if.......else if the score is in the range of 25-27 then show 13-7 else show 12-8.

    Counting this, I need 8 IF statements, but I think there is a limit of 7 embedded if statements I can use.

    Can anyone think of a work-around to this?

    Some notes on the spreadsheet I have:

    I have a macro that places an X on the double-click event, and I do have a cell that keeps score of the number of balls sunk.

    Keep in mind, that this is only one example of the handicap structure, I need to do the same thing for handicap levels 1, 2, 3, 5, 6, 7, 8 and 9.

    If anyone has any questions, please let me know.

    ~Derrick

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: Embedded IF statements

    Hi,

    to work rounf the IFs issue,

    =INDEX({"12-8","13-7","14-6","15-5","16-4","17-3","18-2","19-1","20-0"},MATCH(A1,{30,27,24,21,18,14,11,8,5},-1))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Registered User
    Join Date
    05-04-2009
    Location
    Fall River, MA
    MS-Off Ver
    Excel 2002
    Posts
    9

    Re: Embedded IF statements

    Total perfection! Thank you!!!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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