WPS Office

Free All-in-One Office Suite with PDF Editor

correct-icon

Edit Word, Excel, and PPT for FREE.

correct-icon

Read, edit, and convert PDFs with the powerful PDF toolkit.

correct-icon

Microsoft-like interface, easy to use.

Free download

Windows • MacOS • Linux • iOS • Android

banner

How to use excel if statement with text in Excel

February 13, 2023
5.7K Views

One of Excel's most well-known features is the IF capability, which enables you to conduct reliable comparisons between a value and your expectations. An IF articulation can result in one of two outcomes in this fashion. The primary result is given if your examination is accurate, and the secondary result is given if your correlation is incorrect.

IF (C2 = Yes, then, at that moment, return a 1, else return a 2), for example, is expressed as =IF(C2=Yes,1,2).

Text Is in This Cell (Case-Insensitive)

IF capacity is obviously case-obtuse in success. It suggests that the case in the IF equations won't be perceived by coherent text for text values. For instance, when testing the message values in cells, the two IF equations that follow will produce comparable results.

=IF(J1=excel,yes,no)

=IF(J1=EXCEl,yes,no)

1.   If cell B1 is equal to the word succeed, the IF equation will actually examine its advantages. If this is TRUE, yes will be returned; otherwise, no will be returned. 

2. Additionally, the logical test contention's text values will be checked by the consistent test in the aforementioned IF recipe. Whether the text values are Succeed, Succeed, or Succeed, the IF equation doesn't care whether they are capitalized or lowercase because, in the end, it will produce the same results.

Assuming that a component of the cell fits the explicit message, succeed IF checks are carried out

You can use the IF capability in combination with ISNUMBER and SEARCH Function in success if you want to determine whether a cell's message values are a close match to the specific message rather than a careful match.

1.  The success rates for ISNUMBER and SEARCH are case-coldhearted.

=IF(ISNUMBER(SEARCH(x,B1)),good,bad)

2.  If the IF condition is met, it will check to see if B1 contains the letter x.

In addition, we can use the FIND capacity to take the place of the SEARCH feature in the IF recipe given before. It will produce comparable results.

IF successful, use the Wildcards text value

1. If you want to use a trump card character in an IF formula, for instance, if any of segment B's attributes contain *xc*, return excellent, while the others return awful, return great. The trump card characters cannot be included in an IF recipe directly, but we can combine the IF and COUNTIF capabilities. Let's look at the associated IF equation:

=IF(COUNTIF(B1:B4),*xc*, good, bad)

=IF(C2=”Yes”,1,2)

2. Cell D2 in the previous illustration reads: IF (C2 = Yes, then return a 1, otherwise return a 2)

=IF(C2=1,Yes,No)

3.   Additionally, you can combine several IF works to perform numerous correlations.

=IF (C2>B2,Over Budget,Within Budget)


4. The IF function in D2 in the example above says that if C2 is greater than B2, it should return Over Budget, otherwise it should return Within Budget.)

=IF(C2>B2,C2-B2,0)

5. In the example above, we will return a numerical estimate rather than a written result. Therefore, the equation in E2 reads: IF (Actual is Greater than Budgeted, then Subtract the Budgeted sum from the Actual sum, in any case, bring nothing back).

=IF(E7=”Yes”,F5*0.0825,0)

The formula in F7 in this illustration states that if E7 is true, to calculate the total amount in F5 by 8.25 percent; otherwise, no sales tax is owed, thus return 0).

Did you learn about how to use IF statements with text in excel? You can follow WPS Academy to learn more features of Word Document, Excel Spreadsheets, and PowerPoint Slides. You can also download WPS Office to edit word documents, excel, and PowerPoint for free of cost. Download now! And get an enjoyable and easy working experience.

15 years of office industry experience, tech lover and copywriter. Follow me for product reviews, comparisons, and recommendations for new apps and software.