[Solved] Conditional formatting on text in a text string

Discuss the spreadsheet application
Locked
ser_srd
Posts: 8
Joined: Tue Feb 15, 2022 3:53 am

[Solved] Conditional formatting on text in a text string

Post by ser_srd »

Hello all, hoping that someone can tell me if this is possible at all. I have not found a way to do this yet.

This is about conditional formatting, which I do know how to do, but not in the way I want to at the moment.

Here is what I want to do if possible:

I have a worksheet, and cell A1 has a long string of text in it. Let us say that this is the text:

SONIC3_FTR-2_F_EN-XX_US-GB_51-EN_CCAP_2K_ST_20070115_FAC_i3D_OV

If the text contains CCAP I want cell B1 background to turn green, but if it does NOT contain CCAP B1 background should go red or just stay auto, aka white.

I have done a lot of conditional formatting in the past, but never on text in a text string. BTW, there are never any spaces in these text strings.

Ideas appreciated.
Last edited by robleyd on Wed Jan 15, 2025 8:13 am, edited 3 times in total.
Reason: Add green tick
OpenOffice 4.1.15 0n Windows 7
FJCC
Moderator
Posts: 9623
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Conditional formatting on text in a text string

Post by FJCC »

Set the condition to Formula Is and use the formula

Code: Select all

ISNUMBER(FIND("CCAP";A1))
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
robleyd
Moderator
Posts: 5504
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: Conditional formatting on text in a text string

Post by robleyd »

There is a discussion on this in this topic.

In summary, use a formula e.g.

Code: Select all

ISNUMBER(SEARCH("CCAP";A1;1))
aoo_cond.png
aoo_cond.png (34.7 KiB) Viewed 4201 times
Slackware 15 (current) 64 bit
Apache OpenOffice 4.1.16
LibreOffice 26.2.3.2; SlackBuild for 26.2.3 by Eric Hameleers
---------------
I hate this damn computer, I wish that I could sell it.
It won't do what I want it to, Only what I tell it.
ser_srd
Posts: 8
Joined: Tue Feb 15, 2022 3:53 am

Re: Conditional formatting on text in a text string

Post by ser_srd »

Wow, that was quick.

That worked great!

Thanks all.
OpenOffice 4.1.15 0n Windows 7
Locked