+ Reply to Thread
Results 1 to 15 of 15

How can I write "and" in conditional formatting?

  1. #1
    Registered User
    Join Date
    12-14-2022
    Location
    Bucharest
    MS-Off Ver
    365
    Posts
    92

    Exclamation How can I write "and" in conditional formatting?

    Hello!

    How can I write "and" in the attached photo? So I don't have to click again and again and write another word because it is pretty time consuming.

    Conditional formatting > highlight cells rules > text that contains

    Thank you!
    Attached Images Attached Images
    Last edited by Zero-Sama; 02-02-2023 at 12:58 PM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,053

    Re: How can I write "and" in conditional formatting?

    Hi there.

    A picture is worth 1,000 words. An Excel sheet is worth 1,000 non-editable pictures.

    Please read the yellow banner about sample worksheets, at the top of the screen. Act on its guidelines and post a SMALL sample sheet complete with an explanation and some expected results.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: How can I write "and" in conditional formatting?

    I can't read the details on your picture, but if you select the "Use a formula... " option in the Rules selection, rather than "Text that contains... ", then you could use a formula like:

    =COUNTIF(range,"*"&cell&"*")>0

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    12-14-2022
    Location
    Bucharest
    MS-Off Ver
    365
    Posts
    92

    Exclamation Re: How can I write "and" in conditional formatting?

    Hello!

    I attached the file.

    So, is there a way to write a formula and highlight all the phrases that contain that word?

    For example, what formula could I write to highlight all the phrases that contain the words "Bucuresti" or / and "Brasov"? Only in the "A" column.

    PS: Bucuresti and Brasov are cities from Romania.

    Thank you!
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Zero-Sama; 01-29-2023 at 11:39 AM.

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: How can I write "and" in conditional formatting?

    Like this ? Formula is =OR(ISNUMBER(SEARCH("brasov";$A2));ISNUMBER(SEARCH("Bucuresti";$A2))) ( using European settings)
    Attached Files Attached Files

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: How can I write "and" in conditional formatting?

    Select all the cells from A2:A2920 then click on Conditional Formatting | New Rule | Use a formula... , then put this formula in the dialogue box which pops up:

    =COUNTIF($A2,"*"&"Bucuresti"&"*")+COUNTIF($A2,"*"&"Brasov"&"*")

    Note that you may need to use semicolons ( ; ) instead of commas ( , ) in the formula, and translate the COUNTIF function to your language, depending on your regional settings.

    Click on the Format button | Fill tab and choose your colour, then OK twice to exit the dialogue box.

    There are 51 of them in that range, which should be highlighted if you scroll down.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    12-14-2022
    Location
    Bucharest
    MS-Off Ver
    365
    Posts
    92

    Re: How can I write "and" in conditional formatting?

    Quote Originally Posted by Pete_UK View Post
    Select all the cells from A2:A2920 then click on Conditional Formatting | New Rule | Use a formula... , then put this formula in the dialogue box which pops up:

    =COUNTIF($A2,"*"&"Bucuresti"&"*")+COUNTIF($A2,"*"&"Brasov"&"*")

    Note that you may need to use semicolons ( ; ) instead of commas ( , ) in the formula, and translate the COUNTIF function to your language, depending on your regional settings.

    Click on the Format button | Fill tab and choose your colour, then OK twice to exit the dialogue box.

    There are 51 of them in that range, which should be highlighted if you scroll down.

    Hope this helps.

    Pete
    Hello,

    Would you like to tell me where is the mistake? I press OK and then I try to sort, but there is no green color...

    // LATER EDIT: I use "," instead of ";". My settings for language are for USA. Also, I am using licensed Microsoft 365 if it helps...

    // LATER EDIT 2: @Le Mokko, formula "=OR(ISNUMBER(SEARCH("brasov";$A2));ISNUMBER(SEARCH("Bucuresti";$A2)))" does not work. I replaced ";" with ",". It sorts words with or without the targeted words (Bucuresti or Brasov).
    Attached Images Attached Images
    Last edited by Zero-Sama; 01-29-2023 at 01:07 PM.

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: How can I write "and" in conditional formatting?

    See attached file, where I have set this up for you.

    Hope this helps.

    Pete
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    12-14-2022
    Location
    Bucharest
    MS-Off Ver
    365
    Posts
    92

    Re: How can I write "and" in conditional formatting?

    Quote Originally Posted by Pete_UK View Post
    See attached file, where I have set this up for you.

    Hope this helps.

    Pete
    Hello!

    I made a new file with fewer words.

    I applied the exact rule that you teached me and I attached the file and the photo with the result.

    I don't understand what I do wrong... I entered "bucuresti" and "brasov", but Excel highlights "deva"

    Thank you!
    Attached Images Attached Images
    Attached Files Attached Files

  10. #10
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: How can I write "and" in conditional formatting?

    You applied it to the entire column (not a great idea), so your formula should refer to $A1 not $A2
    Rory

  11. #11
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: How can I write "and" in conditional formatting?

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Works fine for me. So when you opened the sheet you got errors?

  12. #12
    Registered User
    Join Date
    12-14-2022
    Location
    Bucharest
    MS-Off Ver
    365
    Posts
    92

    Re: How can I write "and" in conditional formatting?

    Quote Originally Posted by rorya View Post
    You applied it to the entire column (not a great idea), so your formula should refer to $A1 not $A2
    Hello!

    I attached 2 photos where I show exactly how I do.

    I don't understand where is my mistake...

    @Le Mokko: please take a look at the photos attached here... where is my mistake because I don't understand? Thank you!
    Attached Images Attached Images

  13. #13
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: How can I write "and" in conditional formatting?

    As I said, the formula should refer to $A1 not $A2:

    =COUNTIF($A1,"*"&"Bucuresti"&"*")+COUNTIF($A1,"*"&"Brasov"&"*")

    since you applied it to a range starting with row 1 not row 2.

  14. #14
    Registered User
    Join Date
    12-14-2022
    Location
    Bucharest
    MS-Off Ver
    365
    Posts
    92

    Re: How can I write "and" in conditional formatting?

    Thank you all for your help, I succeed!

  15. #15
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,726

    Re: How can I write "and" in conditional formatting?

    Well, that's good to hear. Thanks for the rep.

    Pete

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 7
    Last Post: 10-21-2019, 03:34 PM
  2. Replies: 6
    Last Post: 11-25-2018, 10:49 AM
  3. Conditional formatting by testing for "True" or "False"
    By Excel_vba in forum Excel General
    Replies: 2
    Last Post: 02-21-2014, 11:26 PM
  4. [SOLVED] Conditional formatting - formula if cell does NOT contain "," or "@"
    By Armitage2k in forum Excel General
    Replies: 12
    Last Post: 12-02-2012, 06:23 AM
  5. Conditional Formatting - Replace date with "YES" or "NO"
    By christinie in forum Excel General
    Replies: 3
    Last Post: 11-01-2012, 04:10 PM
  6. Replies: 2
    Last Post: 08-17-2012, 05:10 AM
  7. [SOLVED] excel should "paste special" a "conditional formatting"
    By lozturk21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-23-2005, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1