Often you may want to use the IF function with the LEFT function in Excel to check if a specific number of characters on the left hand side of a cell are equal to specific text.
You can use the following basic syntax to do so:
=IF(LEFT(A2,6)="Backup","Yes","No")
This particular formula checks if the six characters on the left hand side of cell A2 are equal to “Backup” and returns either “Yes” or “No” accordingly.
The following example shows how to use this formula in practice.
Example: How to Use IF Function with LEFT Function in Excel
Suppose we have the following dataset in Excel that contains information about various basketball players:
Suppose we would like to use the IF function and the LEFT function to check if the six characters on the left hand side of each text in the Position column are equal to “Backup” or not.
We can type the following formula into cell C2 to do so:
=IF(LEFT(A2,6)="Backup","Yes","No")
We can then click and drag this formula down to each remaining cell in column C:
The formula returns “Yes” or “No” to indicate if the six characters on the left hand side of each text in the Position column are equal to “Backup” or not.
Note: We chose to return “Yes” or “No” using the IF function but you can choose to return whatever values you’d like.
Additional Resources
The following tutorials explain how to perform other common tasks in Excel:
Excel: How to Use IF Function with Multiple Conditions
Excel: How to Create IF Function to Return Yes or No
Excel: How to Use an IF Function with Range of Values