[Solved] Change cell background colour based on call content

Discuss the spreadsheet application
Post Reply
krolwioski
Posts: 5
Joined: Wed Jun 24, 2015 2:07 pm

[Solved] Change cell background colour based on call content

Post by krolwioski »

Hello,
I do have a problem as I can't use conditional formatting in that case as I do use more than 3 different values.

a
w
s
n
a/w

I would like to change cell background colour depending on the value that's inside of a cell like this:

a - Cyan 1
w - Black
s - Magenta 1
n - Yellow 1
a/w - Black
empty cell - WHITE FONT + WHITE BACKGROUND

I have read couple of threads on the forum but still it's like black magic for me, for example that one:
viewtopic.php?f=9&t=9697#p45472

Furthermore I do not want to lose my formula from column D "=IF(ISBLANK(S4);" ";S4)", so when there is no data instead of zero I does have blank cell with space. That could be swapped with additional value like: when cell does not have any data then set up font colour to white.

So I put my values manually in a column S, when column D return the same thing but with appropriate visual effect. Please see attached file.
Will anyone be able to help me with that?
Thank you!
Attachments
file 1.xls
file 1
(7.5 KiB) Downloaded 68 times
Last edited by krolwioski on Thu Jul 13, 2017 12:43 pm, edited 1 time in total.
Windows 10 Home
OpenOffice 4.1.3
User avatar
RoryOF
Moderator
Posts: 34618
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: change cell background colour based on call content

Post by RoryOF »

There is an extension to extend Conditional Formatting at
https://extensions.openoffice.org/en/pr ... formatting

It may be that using .xls format will lose any such formatting. You should work in OO's native format, .ods for spreadsheets.
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
krolwioski
Posts: 5
Joined: Wed Jun 24, 2015 2:07 pm

Re: change cell background colour based on call content

Post by krolwioski »

Thank you RoryOF!
Unfortunately I have to work with XLS format as I share those files quite often with people that use excel or different software, most of them do use XLS so I have too.
Will that extension work for someone else if I send file to someone else and that person will open that file on their PC?

EDIT:
Retarding above extensions looks like it's not working properly anyway as with every button press there's error showing up.
Windows 10 Home
OpenOffice 4.1.3
krolwioski
Posts: 5
Joined: Wed Jun 24, 2015 2:07 pm

Re: Change cell background colour based on call content

Post by krolwioski »

Ok I have found out solution.
Conditional formatting where: FORMULA IS: STYLE(D4)

Then add style named XXX, with all formatting as you would like to see it.

So when you put XXX in that cell it will take style with the same name as cell value.

EDIT:
It has to be ODS format. When I use XLS it does not change if I change cell data it keeps style that has been on that cell when saving to XLS format.
Windows 10 Home
OpenOffice 4.1.3
Post Reply