basic if calculation...(?)

zoom

New Member
Joined
Oct 27, 2002
Messages
4
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....
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Iridium

Well-known Member
Joined
Jul 15, 2002
Messages
2,831
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.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
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

=VLOOKUP(A1,Grades,2)

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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,667
Messages
5,597,458
Members
414,145
Latest member
lonnie451

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Top