View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Shane Devenshire[_2_] Shane Devenshire[_2_] is offline
external usenet poster
 
Posts: 3,346
Default Avoiding negative values in IF statements help needed

Hi,

This problem might be better solved with a different approach:

1. Create the following table

Difference Points
-100 0
-6 1
0 2
1 3
7 4

Suppose this is in A1:B6, including titles. Then your formula is

=VLOOKUP(D2-E2,$F$5:$G$9,2,1)

If you could loose by more than 100 points adjust the first number.

If this helps, please click the Yes button.

Cheers,
Shane Devenshire

" wrote:

Hi,

I have the following criteria to asses match results

Away loss by 7 points or more = 0 points
Away loss by 6 points or less = 1
Away draw = 2
Away win by 1 to 6 points = 3
Away win by more than 7 = 4

I used the following equation:
=IF(E2="","",IF(D2-E2<=6,1,IF(E2=D2,2,IF(E2-D2=7,4,IF(E2-
D2<7,3,0)))))

Seemed to mostly work, apart from the last bit. I think I have the
last zero in the wrong place.

This formula if the score was 50-40 (D2=50, E2=40) home win, evaluated
E2-D2<7 as -10 and put 3 in the cell

Thanks for any help

Neil