简体   繁体   中英

How to check if there is a specific text inside a cell in excel

is there anyway to check if there is an existing text in excel?

For example: COLUMN A1 - "CONSTRUCTION -RP" COLUMN B1 - "AM"

I need to check if COLUMN A1 has no "OMA" on it. In terms:

IF (A1 has "OMA" AND B1 is "AM" OR A1 has no OMA) THEN FORMULA HERE ELSE IF (A1 has "OMA" AND B1 IS NOT "AM") THEN FORMULA HERE

Here's a formula that might be of help to you.

=IF(A1="OMA", IF(B1="AM",1+1,2+2), 3+3)

Essentially 1+1, 2+2, and 3+3 would be replaced with the formulas you have if logical test 1 = true, logical test 2 = true, or if neither test held true.

If you have any questions about this just ask below.

Use ISNUMBER(SEARCH())

=IF(OR(AND(ISNUMBER(SEARCH("OMA",A1)),B1="AM"),ISERROR(SEARCH("OMA",A1))),yourformula,yourotherformula)

=IF(OR(AND(ISNUMBER(FIND("OMA",A1)),B1="AM"),ISERROR(FIND("OMA",A1))),1,0)

Replace the 1 and 0 with your formula if true and formula if false. In english this formula does is if either (OMA is in a1 and b1=AM) or (OMA is not in a1), then true, otherwise false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM