[Solved] Background Color Alternating Row Fill

Discuss the spreadsheet application
Post Reply
pjoseph
Posts: 1
Joined: Tue Aug 12, 2008 7:42 pm

[Solved] Background Color Alternating Row Fill

Post by pjoseph »

How does one fill a background color in every other row in a sheet?

For example: I want all odd numbered rows with white background, and all even numbered rows with a light green background.

Menu: Format->Styles and Formatting
Result style, right-click and modify; Background tab, and chose light green color.
Selected the range of cells;
Menu: Format->Conditional Formatting
Checked Condition 1, changed Cell value is to Formula is,
Entered formula ISEVEN(ROW()), and changed Cell Style to Result.

Thanks. :D
Last edited by pjoseph on Tue Aug 12, 2008 11:53 pm, edited 1 time in total.
OOo 2.4.X on Ubuntu 8.x
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Background Color Alternating Row Fill

Post by Villeroy »

Apply one cell-style to the cells and creat a second style for the alternate rows.
Select the range in question
menu:Format>Conditional...
[X] Condition 1
change "Value Is" to "Formula Is" and use one of the following expressions with the style you defined for alternate columns.
ISEVEN(ROW())
ISODD(ROW())
NOT(MOD(ROW();2))
MOD(ROW();2)
the latter 2 work with every 3rd, 4rth, ... as well.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
ken johnson
Volunteer
Posts: 918
Joined: Sun May 31, 2009 1:35 am
Location: Sydney, Australia

Re: [Solved] Background Color Alternating Row Fill

Post by ken johnson »

The SUBTOTAL function enables alternate row shading of filtered columns.
The attachment compares shading based on visibility with that based on row number...
Alt Shade of Visible Rows.ods
Notice columns A and B maintain alternate shading when filtered.
(15.01 KiB) Downloaded 8323 times
Ken Johnson
AOO 4.1.3 on Ms Windows 10
Help improve this forum by clicking the EDIT button on your first post then adding "[Solved]" to its heading once a solution to your problem has been provided.
Ben2K
Posts: 2
Joined: Mon Nov 09, 2009 12:08 am

Re: [Solved] Background Color Alternating Row Fill

Post by Ben2K »

Bravo!!! Great tip! :bravo:
OpenOffice 3.1 on Linux
ayani0sby
Posts: 1
Joined: Wed Dec 04, 2013 4:48 pm

Re: [Solved] Background Color Alternating Row Fill

Post by ayani0sby »

In Microsoft Excel:

Code: Select all

=MOD(ROW(),2)=0
OpenOffice :

Code: Select all

MOD(ROW();2)=0
Please try it, :D
Open Office 4.1, Debian Wheezy
cstanford
Posts: 50
Joined: Fri Nov 21, 2014 5:55 pm

Re: [Solved] Background Color Alternating Row Fill

Post by cstanford »

Using these formulas I find that OO will only shade rows and cells that have no contents in them. If a row has a cell entry, it will not shade that row or cell. Can anybody help with this?
OpenOffice 4.1.1 on Windows 7
Post Reply