Forum Discussion

magui1989's avatar
magui1989
Copper Contributor
Jul 08, 2024

if function

I need a function with if and, it is necessary have different considerations to be accept depends on the gender 

For the men's basketball team, they must be at least 22 years old, have a minimum height of 1.70 meters, a maximum weight of 80 kilos and a grade point average of 3.8 in the race.
For the women's basketball team, they must be a maximum of 21 years old, have a minimum height of 1.60 meters, a maximum weight of 65 kilos and an average grade of 3.8 in the race.
 

3 Replies

  • mathetes's avatar
    mathetes
    Silver Contributor

    magui1989 

    The basic concept would be something like this. Make sure that the columns that record height and weight just record the number in meters and kilos, respectively (i.e., don't add words to the numeric measurements).

    =IF(AND(Sex="M",Age>=22,Height>=1.7,Weight<=80,GPA>=3.8),"Qualifies","Fails")

     

    I am assuming you can figure out the changes to make for the women.

     

     

  • magui1989 

    Did you really mean a max age of 21 for women? In the following, I assumed that you meant min age. But you can easily change the formula if it's really max.

    Let's say:

    Gender in column B (B2 and down), as M or F.

    Age in column C.

    Height in column D.

    Weight in column E.

    Grade point average in column F.

    In - for example - G2:

    =IF(OR(AND(B2="M", C2>=22, D2>=1.7, E2<=80, F2>=3.8), AND(B2="F", C2>=21, D2>=1.6, E2<=65, F2>=3.8)), "Accept", "Reject")

    You can use other text strings of course.

    Fill down.

Resources