A marksheet in Excel needs six formulas: =SUM for the total, the total divided by the maximum marks for the percentage, VLOOKUP with approximate match for the grade, IF with COUNTIF for pass or fail in every subject, RANK.EQ for the class rank, and INDEX with MATCH to pull one student's result onto a report card. This guide builds each one on a 30-student sample and shows the result Excel returns, so you can check your own sheet against it.
Who this is for and what you will have at the end
This is for school and college students learning Excel (making a marksheet is a common practical in computer courses), class teachers and tutors who prepare results, and anyone who wants a quick result sheet without paid software.
By the end you will have:
- A marks table where totals, percentages and grades fill in by themselves.
- A pass/fail column that fails a student who is below the pass mark in any one subject, not only on the total.
- A rank column that handles ties, plus the class topper and pass percentage.
- A one-page report card that fills in when you pick a roll number.
If you would rather start from a finished file, the free template described near the end has all of this built and tested.
Prerequisites
- Excel 2016 or later on Windows or Mac, or Excel for Microsoft 365. Every formula here also works in Excel 2010 and 2013; none of them needs XLOOKUP or the newer dynamic array functions.
- Your school's rules: the maximum marks per subject, the pass mark per subject, the minimum overall percentage and the grade bands. Boards and schools set these differently. The examples use 100 as the maximum, 33 as the pass mark and a nine-band grade scale only as sample values.
The sample marksheet layout
Put one student on each row and one subject in each column. The examples assume this layout:
| Column | Holds | Example (row 2) |
|---|---|---|
| A | Roll number | 1 |
| B | Student name | Aarav Menon |
| C to H | Marks in six subjects, out of 100 each | 54, 60, 46, 39, 50, 55 |
| I | Total | formula |
| J | Percentage | formula |
| K | Grade | formula |
| L | Result | formula |
| M | Rank | formula |
Row 1 holds the headings, and students run from row 2 to row 31. If a student was absent for a paper, type AB in that cell instead of a number. Keep the grade table to the right of the marks, in Q1:R10, with headings in row 1.
Step 1: Total marks with SUM
In I2, add the six subject cells:
=SUM(C2:H2)For the first student this returns 304 (54 + 60 + 46 + 39 + 50 + 55). Copy the formula down to I31 by double-clicking the small square at the bottom-right corner of the cell.
SUM ignores text, so a cell with AB counts as zero marks without breaking the formula. Avoid writing the total as =C2+D2+E2+F2+G2+H2: the plus operator returns #VALUE! as soon as one cell contains AB.
Step 2: Percentage
Divide the total by the maximum marks. With six subjects out of 100, the maximum is 600:
=I2/600The result for the first student is 0.506666..., which Excel shows as 50.67% once you select J2:J31 and choose Home > Number > Percent Style, then click Increase Decimal twice.
Better still, type the maximum (600) in a cell of its own, for example I1 next to the heading, and refer to it with dollar signs so the reference does not move when you copy the formula down:
=I2/$I$1If subjects have different maximums (for example 80 for theory papers), add the maximums in that cell instead of typing 600.
Step 3: Grade with VLOOKUP approximate match
Type the grade table in Q1:R10. The first column is the lowest percentage of each band, sorted from smallest to largest; the second column is the grade:
| Q (From %) | R (Grade) |
|---|---|
| 0% | E2 |
| 21% | E1 |
| 33% | D |
| 41% | C2 |
| 51% | C1 |
| 61% | B2 |
| 71% | B1 |
| 81% | A2 |
| 91% | A1 |
These bands are a sample. Change the cut-offs and grade names to whatever your school uses. Then in K2:
=VLOOKUP(J2,$Q$2:$R$10,2,TRUE)With TRUE as the last argument, VLOOKUP finds the largest value in the first column that is less than or equal to the percentage and returns the grade next to it. The first student's 50.67% is below 51%, so the formula returns C2. A student with 90.33% gets A2, and only 91% or more gets A1.
Two rules from Microsoft's VLOOKUP documentation matter here. First, approximate match assumes the first column is sorted, so keep the From % column in ascending order. Second, if the percentage is smaller than the smallest value in the first column, VLOOKUP returns #N/A, which is why the table starts at 0%.
If you prefer the newer XLOOKUP, the XLOOKUP vs VLOOKUP guide shows the same tier lookup with match_mode. VLOOKUP is used here because it also works in Excel 2016 and 2019, which many school computer labs still run.
Step 4: Pass or fail in every subject
A common mistake is to pass a student whose overall percentage is above the minimum even though one subject is below the pass mark. Check both in one formula. In L2:
=IF(AND(COUNTIF(C2:H2,"<33")+COUNTIF(C2:H2,"AB")=0,J2>=33%),"PASS","FAIL")How it works:
- COUNTIF(C2:H2,"<33") counts the subjects with marks below 33. Blank cells are not counted.
- COUNTIF(C2:H2,"AB") counts the papers marked absent. The first COUNTIF does not see them, because "less than 33" only matches numbers.
- AND requires that count to be zero and the overall percentage to be at least 33%.
Look at a student with 41, 36, 31, 23, 37 and 34. The total is 202 and the percentage is 33.67%, which clears the overall minimum, but two subjects are below 33, so the formula returns FAIL. That is the result most schools expect.
If each subject has a different pass mark, COUNTIF with one number no longer works. Add a row under the headings with the pass mark of each subject (say row 2, with students starting in row 3) and compare the two rows cell by cell inside SUMPRODUCT:
=IF(AND(SUMPRODUCT((C3:H3<>"")*(C3:H3<$C$2:$H$2))+COUNTIF(C3:H3,"AB")=0,J3>=33%),"PASS","FAIL")Each mark is compared with the pass mark directly above it. The (C3:H3<>"") part matters: without it, an empty cell counts as zero and is reported as a failed subject before the marks are even entered. In Excel's comparisons text is never "less than" a number, so AB needs the separate COUNTIF, as before.
Step 5: Rank with RANK.EQ
In M2, rank each total against the whole class. A 0 (or nothing) as the third argument ranks the highest total as 1:
=RANK.EQ(I2,$I$2:$I$31,0)The dollar signs keep the class range fixed when you copy the formula down. Microsoft's RANK.EQ page explains how ties behave: duplicate numbers get the same rank, and they affect the ranks after them. If two students both score 561, both show rank 2 and the next student shows 4. That is the usual way class rank lists are printed. In Excel 2007, use RANK with the same arguments.
To leave out students whose result is incomplete, rank on a helper column that holds the total only when every subject has a mark, and leave it blank otherwise; RANK.EQ skips blank and text cells in the reference range.
Step 6: Topper, pass percentage and subject averages
A small summary block under the marks or on a second sheet answers the questions every result meeting asks.
Name of the topper (the first student with the highest total):
=INDEX($B$2:$B$31,MATCH(LARGE($I$2:$I$31,1),$I$2:$I$31,0))LARGE(...,1) returns the highest total, MATCH finds its row, and INDEX returns the name on that row. Change the 1 to 2 or 3 for the second and third positions. If two students have the same total, MATCH returns the first of them each time, so for tied totals list positions by hand or add a tiny tie-breaker, such as a helper column with =I2-ROW()/100000, and run LARGE on that instead.
Students passed and pass percentage:
=COUNTIF($L$2:$L$31,"PASS")
=COUNTIF($L$2:$L$31,"PASS")/COUNTIF($L$2:$L$31,"?*")The "?*" criterion counts cells that contain any text, so empty rows at the end of the list are not counted as students.
Average, highest and lowest marks in the first subject:
=AVERAGE(C2:C31)
=MAX(C2:C31)
=MIN(C2:C31)AVERAGE, MAX and MIN ignore AB, so an absent student does not drag the class average down to zero. If your school counts an absent paper as zero, enter 0 instead of AB.
Step 7: Report card for one student
A report card is one student's row laid out vertically. On a new sheet named Card, type a roll number in B2 and pull everything else with INDEX and MATCH. Assuming the marks are on a sheet named Marks:
Name: =INDEX(Marks!$B$2:$B$31,MATCH($B$2,Marks!$A$2:$A$31,0))
English: =INDEX(Marks!$C$2:$C$31,MATCH($B$2,Marks!$A$2:$A$31,0))
Total: =INDEX(Marks!$I$2:$I$31,MATCH($B$2,Marks!$A$2:$A$31,0))
Percentage: =INDEX(Marks!$J$2:$J$31,MATCH($B$2,Marks!$A$2:$A$31,0))
Grade: =INDEX(Marks!$K$2:$K$31,MATCH($B$2,Marks!$A$2:$A$31,0))
Result: =INDEX(Marks!$L$2:$L$31,MATCH($B$2,Marks!$A$2:$A$31,0))The 0 in MATCH asks for an exact match, so a roll number that is not on the list returns #N/A instead of the wrong student. To print cards for the whole class, print the Card sheet, change the roll number and print again. A drop-down of roll numbers (Data > Data Validation > Allow: List, Source: =Marks!$A$2:$A$31) avoids typing mistakes.
Highlight low marks and failed students
Colors make a result sheet much faster to read.
- Select C2:H31.
- Choose Home > Conditional Formatting > New Rule, then Use a formula to determine which cells to format.
- Enter =AND(ISNUMBER(C2),C2<33), click Format, pick a light red fill and click OK twice.
ISNUMBER keeps blank cells from turning red before marks are entered. For the result column, select L2:L31 and use Home > Conditional Formatting > Highlight Cells Rules > Text that Contains, once with FAIL in red and once with PASS in green.
To stop impossible marks at the source, select C2:H31 and open Data > Data Validation. Under Allow pick Custom and enter =OR(C2="AB",AND(ISNUMBER(C2),C2>=0,C2<=100)). Excel then refuses 150 or a typo such as 4O (letter O), and still accepts AB.
Common errors and fixes
| What you see | Why | Fix |
|---|---|---|
| #VALUE! in the total | The total adds cells with +, and one cell holds AB or a space | Use =SUM(C2:H2), which ignores text |
| #N/A in the grade | The percentage is below the first value of the grade table, or the table is not sorted | Start the table at 0% and sort From % from smallest to largest |
| A percentage shown as 51.00% gets C2, not C1 | The value is stored as 50.999...% and only displayed rounded | Look up the rounded value: =VLOOKUP(ROUND(J2,4),$Q$2:$R$10,2,TRUE) |
| #DIV/0! in the percentage | The maximum-marks cell is empty | Fill the maximum, or wrap the formula: =IF($I$1=0,"",I2/$I$1) |
| A student with a failed subject shows PASS | The formula checks only the percentage | Add the COUNTIF test from Step 4 |
| Rank changes when you sort the list | The range in RANK.EQ is not locked | Use $I$2:$I$31 with dollar signs |
| Percentage shows 0.51 instead of 51% | The cell is formatted as General | Apply Percent Style |
If the class list has repeated names or roll numbers after copying from another file, the guide to removing duplicates in Excel shows how to find them before you calculate results.
Download the free marksheet template
EpiFive's free Marksheet, Result Sheet and Report Card template (ZIP, about 60 KB) has every formula from this guide already built for 60 students and six subjects. It contains a filled sample and a blank copy.
- Settings: school name, class, exam and session; each subject's maximum and pass marks; the minimum overall percentage; and an editable grade table.
- Marks: totals, percentage, grade, the number of subjects below the pass mark, PASS, FAIL or INCOMPLETE (when a mark is missing), and rank, with low marks and AB highlighted.
- Report Card: pick a roll number to get a printable card with a remark for the grade and signature lines.
- Summary: pass percentage, class average, the top three, subject-wise averages and the grade distribution, with two charts.
There are no macros, so the file opens without security prompts. It is free for study, teaching and classroom use.
Checklist
- Maximum marks are in one cell, and the percentage formula refers to it with dollar signs.
- The grade table starts at 0% and is sorted from smallest to largest.
- Pass/fail checks every subject with COUNTIF, not only the overall percentage.
- AB is used for absent papers, and SUM, AVERAGE and COUNTIF handle it.
- RANK.EQ uses a locked range, and ties show the same rank.
- Conditional formatting highlights marks below the pass mark and FAIL results.
- The report card looks up by roll number with an exact MATCH.
What we checked
- Built a 30-student marksheet with these formulas and recalculated it in desktop Excel for Microsoft 365 on Windows on 2026-12-03. The workbook has 709 formulas and Excel reported no error values, in both the filled sample and the blank copy.
- Recalculated the worked example by hand: 54 + 60 + 46 + 39 + 50 + 55 = 304, and 304 / 600 = 50.67%, which falls in the 41% band of the sample scale, so the grade is C2. Excel returned the same values.
- Checked the pass/fail rule on marks of 41, 36, 31, 23, 37 and 34: total 202, 33.67% overall, two subjects below 33, result FAIL. Excel returned FAIL and counted two subjects below the pass mark.
- Opened Microsoft's VLOOKUP page on 2026-12-03: approximate match (TRUE) assumes the first column is sorted, and a lookup value smaller than the smallest value in the first column returns #N/A.
- Opened Microsoft's RANK.EQ page on 2026-12-03: duplicate numbers get the same rank, the top rank of that set, and they affect the ranks of the numbers after them.
- Opened Microsoft's COUNTIF page on 2026-12-03 to confirm the range and criteria arguments and the * and ? wildcards.
- Tested edge cases in a scratch workbook in the same Excel: with totals 600, 561, 561 and 500 plus a blank cell, an empty-text cell and AB in the range, RANK.EQ returned 2 for both 561s and 4 for 500, so blanks and text were skipped. ="AB"<33 returned FALSE. The per-subject SUMPRODUCT test returned 1 failed subject with the blank-cell guard and 2 without it. VLOOKUP of 0.50999 returned C2, and of ROUND(0.50999,4) returned C1.
- Not checked: Google Sheets, LibreOffice Calc and Excel for Mac were not tested. Board and school grading rules were not checked; the pass mark and grade bands in this guide are sample values to replace with your own.
Last tested: 2026-12-03
References
- Microsoft Support: VLOOKUP function
- Microsoft Support: COUNTIF function
- Microsoft Support: RANK.EQ function
- Microsoft Support: INDEX function
- Microsoft Support: MATCH function
- Microsoft Support: LARGE function
- Microsoft Support: IF function
- Microsoft Support: Apply data validation to cells
Comments
Questions and tips are welcome. Comments are checked by the EpiFive team before they appear; please do not share passwords, phone numbers or other private details.