0:00
hi everyone in this video I'll
0:02
demonstrate how to shade alternate rows
0:04
in Excel to enhance the readability of
0:05
our spreadsheets this simple technique
0:07
can make your data easier to follow and
0:09
more visually appealing let's dive in
0:12
we'll achieve this using two built-in
0:14
Excel functions row and mod the row
0:16
function Returns the row number of the
0:18
cell where the formula is applied for
0:20
instance if the formula is in cell A3
0:23
row would return three and if it's in
0:25
cell a 10 it would return 10 the mod
0:28
function takes two parameters number and
0:30
divisor here number is the value you
0:33
want to divide and divisor is the value
0:35
by which you want to divide this
0:37
function Returns the remainder of the
0:38
division for example if you provide five
0:41
as the first parameter and three as the
0:43
second to the mod function it returns
0:45
two as the result because the remainder
0:46
when 5 is divided by 3 is two when we
0:49
use the row function as the first
0:50
parameter of the mod function and two as
0:53
the second parameter the mod function
0:54
divides the row number by two if the row
0:57
number is even the remainder will be
0:59
zero if if the row number is odd the
1:01
remainder will be one the complete
1:03
formula checks if the result equals zero
1:06
this means that if the row number is
1:07
even the formula will return true
1:10
otherwise it will return false for
1:12
example in cell I2 the formula evaluates
1:15
to true because the row function returns
1:17
two when two is divided by two the
1:20
remainder is zero since this remainder
1:22
matches zero the formula returns a true
1:24
Boolean value in cell I3 the formula
1:27
evaluates to false because the row
1:29
function return returns three when 3 is
1:31
divided by two the remainder is one
1:34
since this remainder does not match zero
1:36
the formula returns a false now select
1:39
the range of your data then go to the
1:41
Home tab and click on conditional
1:42
formatting choose new rule from the
1:44
dropdown here select use the formula to
1:47
determine which cells to format in the
1:49
formula box enter the formula shown on
1:52
the screen now click on format select
1:54
your fill color and hit okay then click
1:57
okay again and there you have it
1:59
alternate rows are now
2:05
shaded next let's shade every third row
2:08
follow the same steps select your data
2:10
go to conditional formatting and choose
2:13
new rule this time enter three for the
2:15
second parameter in mod function this
2:17
will shade every third row select your
2:20
desired fill color click okay and there
2:22
you go every third row is now
2:27
shaded this way you can shade any inth
2:29
row the sheet simply by changing the
2:31
value of the second parameter in the mod
2:33
function for example if you enter five
2:35
as the second parameter conditional
2:37
formatting will shade every fifth row in
2:56
sheet finally let's shade groups of rows
2:59
specifically two rows shaded followed by
3:02
two unshaded rows again go to
3:05
conditional formatting and new rule
3:07
enter the formula shown on screen this
3:09
will shade the first two rows of each
3:10
group of eight choose your fill color
3:12
and click okay now you'll see that every
3:15
group of two rows is shaded making your
3:26
clearer to shade four rows followed by
3:29
four un shaded rows again go to
3:32
conditional formatting and new rule
3:34
enter the formula shown on screen this
3:36
will shade the first four rows of each
3:53
eight have you noticed that the
3:55
conditional formatting doesn't
3:57
consistently shade the rows in the first
3:58
group when I'm move the selection to a
4:00
new location the data sometimes contains
4:03
one shaded row and other times two or
4:05
three this inconsistency occurs because
4:07
the row function Returns the current row
4:09
number which is then manipulated by the
4:11
mod function to ensure the first group
4:13
is always shaded I slightly modified the
4:15
formula by subtracting the row number of
4:17
the First Data row within the formula
4:19
for example if the data range starts
4:21
from cell A1 I subtract one in the mod
4:24
function after the row function if the
4:26
data range starts from F5 I subtract
4:28
five in the formula this adjustment
4:30
guarantees that the first group is
4:36
shaded if you found this tutorial
4:38
helpful please give it a thumbs up
4:40
subscribe to our channel for more Excel
4:42
tips and let us know in the comments if
4:44
there's anything else you like to learn