basic if calculation...(?)

zoom

New Member
hi,
i have this basic project of a class of students where i need to gather information in regards to exam results. Using an if statement i've managed to assign each student a grade (A+ to D) but now need to log the number of failures and the percentage failed in a separate cell. My guess is it involves another if statement but i'm unsure as to how i might code this. I've tried stuff like 'IF Final Result = 'D' etc but i seem to be a little way off & i'm new to excel.

thx for any replies....

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Iridium

Well-known Member
On 2002-10-29 03:31, zoom wrote:
hi,
i have this basic project of a class of students where i need to gather information in regards to exam results. Using an if statement i've managed to assign each student a grade (A+ to D) but now need to log the number of failures and the percentage failed in a separate cell. My guess is it involves another if statement but i'm unsure as to how i might code this. I've tried stuff like 'IF Final Result = 'D' etc but i seem to be a little way off & i'm new to excel.

thx for any replies....

To get you started (this is from the Excel help file):

If AverageScore is Then return
Greater than 89 A
From 80 to 89 B
From 70 to 79 C
From 60 to 69 D
Less than 60 F

You can use the following nested IF function:

IF(AverageScore>89,"A",IF(AverageScore>79,"B",
IF(AverageScore>69,"C",IF(AverageScore>59,"D","F"))))
In the preceding example, the second IF statement is also the value_if_false argument to the first IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement. For example, if the first logical_test (Average>89) is TRUE, "A" is returned. If the first logical_test is FALSE, the second IF statement is evaluated, and so on.

MrExcel MVP
On 2002-10-29 03:35, Chris Chattin wrote:
On 2002-10-29 03:31, zoom wrote:
hi,
i have this basic project of a class of students where i need to gather information in regards to exam results. Using an if statement i've managed to assign each student a grade (A+ to D) but now need to log the number of failures and the percentage failed in a separate cell. My guess is it involves another if statement but i'm unsure as to how i might code this. I've tried stuff like 'IF Final Result = 'D' etc but i seem to be a little way off & i'm new to excel.

thx for any replies....

To get you started (this is from the Excel help file):

If AverageScore is Then return
Greater than 89 A
From 80 to 89 B
From 70 to 79 C
From 60 to 69 D
Less than 60 F

You can use the following nested IF function:

IF(AverageScore>89,"A",IF(AverageScore>79,"B",
IF(AverageScore>69,"C",IF(AverageScore>59,"D","F"))))
In the preceding example, the second IF statement is also the value_if_false argument to the first IF statement. Similarly, the third IF statement is the value_if_false argument to the second IF statement. For example, if the first logical_test (Average>89) is TRUE, "A" is returned. If the first logical_test is FALSE, the second IF statement is evaluated, and so on.

Chris,

That is an example how to use IF. However, the task for which the formula is set up can better be done with VLOOKUP or LOOKUP...

=VLOOKUP(A1,{0,"F";60,"D";70,"C";80,"B";89,"A"},2)

or

where Grades a 2-column list, consisting of

{0,"F";
60,"D";
70,"C";
80,"B";
89,"A"}

By the way,

=COUNTIF(Range,"F")

would give the number of failures. Once you have that, you can determine the percentage failed.

zoom

New Member
many thx, works really well...!!

:0)

Replies
5
Views
141
Replies
4
Views
208
Replies
7
Views
255
Replies
3
Views
907
Replies
3
Views
449

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,769
Messages
5,833,588
Members
430,221
Latest member
pgn29

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back