[Solved] Highlight cells containing specified words

Discuss the spreadsheet application

[Solved] Highlight cells containing specified words

Postby callkalpa » Fri May 28, 2010 11:43 am

hi all,

I've got a set of words (about 10) and a calc spreadsheet. I want to highlight cells in the spreadsheet which contains any of the words in the set.

Is this possible, if so how can I accomplish this task?

Thanks in advance.
Last edited by Hagar Delest on Sat May 29, 2010 9:04 pm, edited 1 time in total.
Reason: tagged [Solved].
OpenOffice 3.1 on Fedora 12
callkalpa
 
Posts: 4
Joined: Thu May 13, 2010 2:28 pm

Re: highlight cells containing specified words

Postby jrkrideau » Fri May 28, 2010 3:37 pm

callkalpa wrote:hi all,

I've got a set of words (about 10) and a calc spreadsheet. I want to highlight cells in the spreadsheet which contains any of the words in the set.

Is this possible, if so how can I accomplish this task?

Thanks in advance.


You might want to take a look at Conditional Formatting in Help. I'm not sure if it can handle 10 conditions but it may. Look under the Parameter subheading,
LibreOffice 6.4.7.2; Ubuntu 20.04
jrkrideau
Volunteer
 
Posts: 3811
Joined: Sun Dec 30, 2007 10:00 pm
Location: Kingston Ontario Canada

Re: highlight cells containing specified words

Postby acknak » Fri May 28, 2010 5:20 pm

You can handle any number of words in a conditional expression by using a formula condition, something like this:
ISNUMBER(SEARCH("\<(a|an|the|that|those|these|this)\>";A19))

The text in red is a pattern (or, "regular expression") that matches any of the given words.

If the words can appear anywhere in the cell text, you can use a pattern like this:
.*\<(a|an|the|that|those|these|this)\>.*

Here's an example:
Attachments
highlight_words.ods
(15.11 KiB) Downloaded 302 times
AOO4/LO5 • Linux • Fedora 23
User avatar
acknak
Moderator
 
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Highlight cells containing specified words [solved]

Postby callkalpa » Sat May 29, 2010 8:44 am

Thanks and it worked.
OpenOffice 3.1 on Fedora 12
callkalpa
 
Posts: 4
Joined: Thu May 13, 2010 2:28 pm


Return to Calc

Who is online

Users browsing this forum: KatBl and 19 guests