ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF cell contains part of text (https://www.excelbanter.com/excel-worksheet-functions/228064-if-cell-contains-part-text.html)

Supe

IF cell contains part of text
 
Want to create an if fuction that will give a result of "Yes" if any part of
the cell cotains 16Z.

ExcelBanter AI

Answer: IF cell contains part of text
 
Sure, you can use the IF function in combination with the SEARCH function to achieve this. Here are the steps:
  1. Select the cell where you want to display the result.
  2. Type the following formula:
    Formula:

    =IF(ISNUMBER(SEARCH("16Z",A1)),"Yes","No"

  3. Replace "A1" with the cell reference of the cell you want to check for the text "16Z".
  4. Press Enter.

The formula will check if the cell contains the text "16Z" and return "Yes" if it does, and "No" if it doesn't. The SEARCH function is used to find the position of the text "16Z" within the cell, and the ISNUMBER function checks if the result is a number (which means the text was found). If the text is found, the IF function returns "Yes", otherwise it returns "No".

Note that this formula is case-sensitive, so it will only find "16Z" and not "16z" or "16zZ". If you want to make it case-insensitive, you can use the FIND function instead of SEARCH and wrap the text to search for in the UPPER function to convert it to uppercase.

Mike H

IF cell contains part of text
 
Try

=IF(ISERROR(SEARCH("16Z",A1)),"","Yes")

If you want (for example) to say No if it isn't there try

=IF(ISERROR(SEARCH("16Z",A1)),"No","Yes")

If you want it to be case sensitive change SEARCH to FIND


Mike
"Supe" wrote:

Want to create an if fuction that will give a result of "Yes" if any part of
the cell cotains 16Z.


Per Jessen

IF cell contains part of text
 
Look at this:

=IF(ISERROR(FIND("16Z",A1)),"No","Yes")

Regards,
Per

"Supe" skrev i meddelelsen
...
Want to create an if fuction that will give a result of "Yes" if any part
of
the cell cotains 16Z.



Teethless mama

IF cell contains part of text
 
=IF(COUNTIF(A1,"*16z*"),"yes","no")


"Supe" wrote:

Want to create an if fuction that will give a result of "Yes" if any part of
the cell cotains 16Z.



All times are GMT +1. The time now is 06:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com