Letter Conditions

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Letter Conditions

Post by JoeExcelHelp »

I realize this isnt the correct format but i hope it gives you an understanding.. trying to create a conditional format based on the existence of 2 unique letters in a cell.. can you assist?

Code: Select all

=IF(ISNUMBER(and(SEARCH("T",G13),search("B",G13)),TRUE,FALSE)

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Letter Conditions

Post by HansV »

Try

=AND(ISNUMBER(SEARCH("T",G13)),ISNUMBER(SEARCH("B",G13)))
Best wishes,
Hans

JoeExcelHelp
5StarLounger
Posts: 1177
Joined: 22 Jul 2013, 18:29

Re: Letter Conditions

Post by JoeExcelHelp »

It works but I seem to have another formula influencing the one you just provided

Cell value G13 = B1T1
This is another formula is my condition:

Code: Select all

=IF(ISNUMBER(SEARCH("B",G13)),TRUE,FALSE)
This the one you just provided:

Code: Select all

=IF(AND(ISNUMBER(SEARCH("T",G13)),ISNUMBER(SEARCH("B",G13))),TRUE,FALSE)
For some reason it keeps defaulting to the first condition and it seems odd because the first condition mentions "B" only and the 2nd condition mentions "B and T"

User avatar
HansV
Administrator
Posts: 78481
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Letter Conditions

Post by HansV »

Select the cell, then select Conditional Formatting > Manage Rules...
Switch the order of the rules.

By the way,

=IF(ISNUMBER(SEARCH("B",G13)),TRUE,FALSE)

can be shortened to

=ISNUMBER(SEARCH("B",G13))

and

=IF(AND(ISNUMBER(SEARCH("T",G13)),ISNUMBER(SEARCH("B",G13))),TRUE,FALSE)

can be shortened to the formula that I posted:

=AND(ISNUMBER(SEARCH("T",G13)),ISNUMBER(SEARCH("B",G13)))
Best wishes,
Hans