You are here:

Excel/Logical test to return a grade


Hi David,

I would be obliged if you could help me out - I have been trying to work out a If formulae to return a A, B, or C grade (from a totals cell) depending on a point range i.e. Class A 81 to 100 points) Class B  (71 to 80 points) Class C  (60 to 70 points)   

Thanks in anticipation,

Screen Print of Solution
Screen Print of Soluti  
Hello Donal,

Thank you for your question.  This is easily accomplished in Excel.

First, you need to decide what to return if the grade is below 60 points. In the answer below, I used the word "Fail," but you can use whatever suits your purpose.

We will use the Vlookup formulas to look up the number grade and then return a letter grade.  

The first step is to set up a table array for the Vlookup formula to search.  It can be anywhere on the worksheet or even on a different worksheet.  On the worksheet I used to test this formula, I used the range of F3:G6.  In F3, type "0", in F4 type "60", in F5 type "71" and in F6 type "81".  Then in G3 type whatever value you want for any grade below 60.  For my test, I used the word "Fail" but you can use whatever you want the formula to return.  Type that in G3.  Then in G4, type "C", in G5 type "B" and in G6 type "A".

Next, place this formula in B1 or whatever cell you want the results to be shown: =VLOOKUP(A1,F3:G6,2,1).  If the table array is not F3:G6, then you will need to change that part of the formula.

Now you can place the number grade in A1 and the results from the table array will appear in B1.  Again, if your number grade is not in A1, change that part of the formula above.  The formula above assumes your number grade is in A1 and the table array is in F3:G6.

Hope this helped. If for any reason it fails to work or you need additional help, feel free to submit a follow-up question.

Good luck!

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


David W. Cofer


I can answer MS Excel questions regarding Excel Formulas, Functions, Worksheets, Data Validation, Conditional Formating, Lookup, Pivot Tables and Logic Functions, as well as other general Excel questions. I do not answer questions regarding Charts, Macros, Visual Basic or Programming. Please include the version of Excel you are using. That helps me provide an answer that will work on your system. Also, do not submit duplicate questions to several experts at the same time. If several of us are answering the same question at the same time, it is a waste of time and resources. If the first expert you ask does not provide an acceptable answer, then ask a second expert. As we are volunteers, our time is valuable, and it is a waste of time for 5 of us to be working on the same question at the same time. Thanks for your understanding.


I have used MS Excel for over 20 years and am familiar with all versions back to 1993. I currently use Excel 2013 and assist those using versions going back to 2000. I use Excel extensively at both work and home.

I hold a B.A. degree in Psychology.

©2016 All rights reserved.