# IF Statement Help

Discussion in 'Mac Basics and Help' started by jbgolfnut, Aug 24, 2011.

1. ### jbgolfnut macrumors newbie

Joined:
Aug 24, 2011
#1
I am trying to set up a template for determining the winners of a skins game.
Each of the eighteen holes has an assigned handicap, and based on the golfers handicap he may get 0, 1, or 2 strokes. For example, one of the holes has a handicap of 2, so any golfer with a handicap of greater than 1 will get a stroke on that hole, (IF statement is: IF(Handicap>1, score-1,score)). The problem is that if the golfer's handicap is greater than 19, he should get two strokes on that hole. How can I make that a condition of the formula?

2. ### Shawnpk macrumors 6502

Joined:
Jan 13, 2011
Location:
Los Angeles, CA
#2
Use an if else statement.

if ((handicap >= 1) && (handicap <= 18))
{
code
}

else if (handicap >= 19)
{
code
}

3. ### jbgolfnut thread starter macrumors newbie

Joined:
Aug 24, 2011
#3
If Statement Help

Thank you for your prompt reply, Shawnpk. I am trying to do this as a spreadsheet in Numbers, using a different formula for each hole, and that script looks like computer programming. What would it look like in Numbers script, and can you even do an If/Else statement in Numbers?

4. ### Shawnpk macrumors 6502

Joined:
Jan 13, 2011
Location:
Los Angeles, CA
#4
Sorry. I'm so used to seeing coding questions that I assumed yours was a coding question. I don't really have much Numbers experience so I'm afraid I can't be any help.

5. ### MaxBeagleton macrumors member

Joined:
Aug 9, 2010
Location:
Upstate NY
#5
Nest your IFs

IF(HC>18,score-2,IF(HC>1,score-1,score))

6. ### jbgolfnut thread starter macrumors newbie

Joined:
Aug 24, 2011
#6
If Statement Help

MaxBeagleton, thank you so much for taking the time to help a geriatric newbie with his little project. The formula worked perfectly. I suspected I would need to use nested IF statements, but had no idea what the format was in Numbers. Thanks again for your kindness.