How to Use IF and LEFT Functions in Excel to Extract Grades
Question details
The user needs an Excel formula utilizing multiple conditions (IF) and the LEFT function to extract the first two characters of a resit grade when the first-sit grade equals 'MV'.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Evaluating student grades by checking multiple conditions and conditionally extracting partial text from a cell.
- Observed behavior
- Correctly applying a nested IF and LEFT formula to extract the substring, resolving syntax errors caused by missing parentheses.
Verify whether your data is structured as an official Excel Table, as the example uses structured references like [@[Resit grade]]. If using a standard range, be prepared to replace these with standard cell references like A2.
Create a Nested IF Formula with the LEFT Function
Use this solution to evaluate multiple logical tests and conditionally extract a specific number of characters from a text string using proper syntax.
When nesting functions within an IF statement, you do not need to add an additional equals sign before the nested function. However, you must ensure that functions like LEFT have their arguments enclosed in parentheses.
The formula structure evaluates the first condition. If true, it returns a value; if false, it moves to the second IF statement which contains the LEFT function to extract the first two characters of the resit grade.
Click on the cell in your Excel table where you want the final calculated grade to be displayed.
Begin your formula by checking if the resit grade is missing: =IF([@[Resit grade]]="Not found",[@[1st sit Grade]],
Add the second IF condition to check for 'MV' and apply the LEFT function, making sure to use parentheses correctly: IF([@[1st sit Grade]]="MV",LEFT([@[Resit grade]],2),[@[Resit grade]]))
Put it all together: =IF([@[Resit grade]]="Not found",[@[1st sit Grade]],IF([@[1st sit Grade]]="MV",LEFT([@[Resit grade]],2),[@[Resit grade]])). Press Enter to apply the formula to the cell.

Process Complex Formulas Easily with WPS Spreadsheet
You can seamlessly build, edit, and troubleshoot nested IF and text functions using WPS Spreadsheet. With its intuitive interface and built-in formula hints, you can efficiently calculate data without syntax errors.
- 1. Open your data file: Launch WPS Spreadsheet and open your existing table or workbook.
- 2. Start typing the formula: Select your target cell and type =IF( to trigger the formula autocomplete.
- 3. Nest the LEFT function: Follow the on-screen parameter hints to easily nest LEFT() without missing the required parentheses.
- 4. Apply to the column: Press Enter to execute, and drag the fill handle to apply the formula across your entire dataset.

Frequently Asked Questions
Why does my nested LEFT function return a syntax error?
This usually happens if you forget to place parentheses around the arguments of the LEFT function (e.g., LEFT(text, num_chars)) or if you accidentally add an extra equals sign inside the nested IF formula.
How do I convert table references like [@[Resit grade]] to normal cell references?
Simply replace the bracketed table reference with the corresponding cell address. For example, if the 'Resit grade' is in column C row 2, replace [@[Resit grade]] with C2.
What does the number 2 mean in the LEFT formula?
In the function LEFT([@[Resit grade]], 2), the number 2 specifies that Excel should extract exactly two characters starting from the very left side of the text string.




