Median vs Average wages

Why do politi­cians lie to us when talk­ing about aver­age wages? Let’s ask Excel.

Medi­an vs Aver­age wages 

Let’s cal­cu­late some aver­age. The AVERAGE func­tion is a sim­ple func­tion that sums up val­ues from all cells in a range and divides it by the num­ber of cells with val­ues (Fig. 1). 

=AVERAGE(D2:D12)

AVERAGE function
Fig. 1 AVERAGE function

In our exam­ple, the aver­age is $2,900. It means that 8 peo­ple earn less, which gives us around 80% of all peo­ple. It’s impor­tant that one per­son at the bot­tom earns much more than the rest and affects our aver­age more than oth­er peo­ple (Fig. 2). 

Average wages
Fig. 2 Aver­age wages

If we want to talk more pre­cise­ly about the dis­tri­b­u­tion of those wages, we can use the MEDIAN func­tion which returns the val­ue in the mid­dle (Fig. 3). 

=MEDIAN (D2:D12)

MEDIAN function
Fig. 3 MEDIAN function

Since our val­ues are sort­ed, we can clear­ly see the mid­dle val­ue, which is $2,000. We can see that 50% of peo­ple earn this val­ue or less and 50% of peo­ple earn this val­ue or more (Fig. 4). 

Median value
Fig. 4 Medi­an value

If we have an even num­ber of val­ues and there are two mid­dle val­ues, the MEDIAN func­tion cal­cu­lates the aver­age of those two val­ues near the mid­dle line (Fig. 5).

=MEDIAN(G2:G11)

MEDIAN function with even number of cells
Fig. 5 MEDIAN func­tion with even num­ber of cells

We can see that it cal­cu­lat­ed the mid­dle val­ue (Fig. 6). 

Median value
Fig. 6 Medi­an value

If we add one zero to cell D12 which belongs only to one per­son, we can see that the aver­age hit $11,900. It means that only one per­son earns more that the aver­age. On the oth­er hand, the medi­an val­ue stayed the same. It’s very impor­tant to know this dif­fer­ence (Fig. 7). 

Higher average
Fig. 7 High­er average

I also want to add one col­umn with the RAND func­tion (Fig. 8).

=RAND()

RAND function
Fig. 8 RAND function

I want to show you that we don’t have to have our data sort­ed to use the MEDIAN func­tion (Fig. 9). 

Random order, median number the same
Fig. 9 Ran­dom order, medi­an num­ber the same

https://www.youtube.com/watch?v=wLV-xl1735s

Count words in a cell 

How can we count the num­ber of words in a cell?

Count words in a cell 

We can count the num­ber of spaces between words. Let’s have a look at our first exam­ple. In cell A2, we have spaces between words and at the end of each line, so the case is sim­ple. We can use the LEN func­tion here that counts the length of text (Fig. 1).

=LEN(A2)

LEN function
Fig. 1 LEN function

Now, that we have the num­ber of signs, we can remove spaces. We can use the SUBSTITUTE func­tion here. This func­tion will change the old text, which in our case is a space into new text. And since we want to remove spaces, our new text will be an emp­ty text string writ­ten in dou­ble quotes (Fig. 2). 

=SUBSTITUTE(A2,” “,“”)

Fig. 2 SUBSTITUTE function

We can see that the func­tion removed all spaces from our text (Fig. 3). 

No spaces
Fig. 3 No spaces

Now, we can count the length of the text with­out spaces using the LEN func­tion (Fig.4).

=LEN(SUBSTITUTE(A2,” “,“”)

Counting the text length
Fig. 4 Count­ing the text length

Now we know the length (Fig. 5).

Text length
Fig. 5 Text length

Since we know how many spaces there are, we can use the for­mu­la to count the words. We just have to sub­tract this for­mu­la from the pre­vi­ous one (Fig. 6). 

=LEN(A2)-LEN(SUBSTITUTE(A2,” “,“”))

 Subtracting formulas
Fig. 6 Sub­tract­ing formulas

And we have the num­ber of spaces (Fig. 7).

Number of spaces
Fig. 7 Num­ber of spaces

We still have to remem­ber that to count the num­ber of words, we have to add 1 because there is only one space between two words (Fig. 8).

=LEN(A2)-LEN(SUBSTITUTE(A2,” “,“”))+1

One space between two words
Fig. 8 One space between two words

Now we know the num­ber of words in each cell. 

Number of words
Fig. 9 Num­ber of words

If we want to count words from all cells, we can use almost the same for­mu­la. The only thing we have to change is the range which now will be from A2 to A4 (Fig. 10). 

=LEN(A2:A4)-LEN(SUBSTITUTE(A2:A4,” “,“”))+1

Adding a new range
Fig. 10 Adding a new range

In Dynam­ic Array Excel, the results will be spilled, how­ev­er we can sum the up (Fig. 11).

Split results
Fig. 11 Split results

In the pre­vi­ous ver­sion of Excel we can use the the SUMPRODUCT func­tion (Fig. 12). 

=SUMPRODUCT(LEN(A2:A4)-LEN(SUBSTITUTE(A2:A4,” “,“”))+1

 SUMPRODUCT function
Fig. 12 SUMPRODUCT function

Final results (Fig. 13).

Final result
Fig. 13 Final result

https://www.youtube.com/watch?v=ywuJZ8u_hDA

Count cells with text, COUNTIF function and wildcards

What to do if we want to count cells with text?

Count cells with text, COUNTIF func­tion and wildcards 

For me, the sim­plest solu­tion is using the COUNTIF func­tion and wild­cards. We have an aster­isk that rep­re­sents any text string, even an emp­ty one. We also have a ques­tion mark that rep­re­sents just one sin­gle sign (Fig. 1). 

 Wildcards
Fig. 1 Wildcards

Let’s start with count­ing all cells with text. First, we have to select a prop­er range and press the F4 key to lock it. Then, we have to write an aster­isk in dou­ble quotes so that it counts any text string, even an emp­ty one (Fig. 2). 

=COUNTIF($B$2:$B$11,”*”)

Proper range and an asterisk
Fig. 2 Prop­er range and an asterisk

And just like that we have 4 cells with text. In cell B6 I have past­ed an emp­ty text string and even if we see noth­ing, Excel counts it as a cell with an emp­ty text string. But, what can we do if we don’t want to count emp­ty text strings? We can copy our for­mu­la and add a ques­tion mark next to the aster­isk. It does­n’t mat­ter if it’s before or after the sign (Fig. 4).

=COUNTIF($B$2:$B$11,”?*”)

Formula modification
Fig. 4 For­mu­la modification

This way we count­ed all cells that have at least one sign (Fig. 5). 

Results
Fig. 5 Results

If we want to count all not emp­ty cells, we can change our cri­te­ria to the <> signs (Fig. 6). 

=COUNTIF($B$2:$B$11,”<>”)

Adding <> signs
Fig. 6 Adding <> signs

How­ev­er, the sim­plest solu­tion in most cas­es would be using the COUNTA func­tion, where we don’t have to wor­ry about any cri­te­ria (Fig. 7). 

=COUNTA(B2:B11)

COUNTA function
Fig. 7 COUNTA function

https://www.youtube.com/watch?v=8ywd-H7ALc8

Sparklines Chart in cell | Excel Tips 30

If we want to show our data trend, we can use line charts, how­ev­er they are usu­al­ly large. If we want some­thing sim­ple and small, like a chart in a cell, we can use Sparklines.

Sparklines Chart in cell

All we have to do is to select one emp­ty cell, then go to the Insert tab, then go to Sparklines and select the Line Sparkline option. What we will get is a Cre­ate Sparkline win­dow, where we have to select a a prop­er range and check if loca­tion is good.(Fig. 1). 

 Creating a sparkline
Fig. 1 Cre­at­ing a sparkline

After press­ing OK and drag­ging it down, we have trends for oth­er coun­tries (Fig. 2). 

Ready trends
Fig. 2 Ready trends

If we want to add some mark­ers, we have to open the Mark­er Col­or bar and choose prop­er options (Fig. 3). 

Adding markers
Fig. 3 Adding markers

After adding mark­ers, spar­lines look as fol­lows. If we want to make them big­ger, we have two options. We can sim­ply enlarge the cells or we can merge a few cells using the Merge & Cen­ter option from the Insert tab (Fig. 4).

Cell merging
Fig. 4 Cell merging

Let’s insert a col­umn sparkline there (Fig. 5). 

Inserting a column sparkline
Fig. 5 Insert­ing a col­umn sparkline

I per­son­al­ly don’t like it too much (Fig. 6). 

Columns
Fig. 6 Columns

Let’s change it to line chart again (Fig. 7). 

Lines
Fig. 7 Lines

https://www.youtube.com/watch?v=MpOwtENWIzA

Pie Chart and Percentage % Data Labels | Excel Tips 29

If you have a small dataset, a pie chart is one of the best ways to show it. How can we insert a pie chart?

Pie Chart and Per­cent­age % Data Labels | Excel Tips #29

Let’s start with a sin­gle cell, then go to the Insert tab, then 2D Pie com­mand. And there we have it (Fig. 1). 

A new pie chart
Fig. 1 A new pie chart

We have to remem­ber that a pie chart will include the whole text before num­bers, which, in our case are cities and coun­tries. (Fig. 2). 

Whole text before numbers
Fig. 2 Whole text before numbers

We don’t want to see coun­tries because there will be too many names. Let’s delete our chart and select prop­er ranges, i.e. the City and the Num­ber of res­i­dents columns. Then, select the Insert tab, and 2D Pie com­mand (Fig. 3). 

A pie chart based on two columns
Fig. 3 A pie chart based on two columns

The best part of pie charts are Data Labels. I per­son­al­ly like the Data Call­out option best. We have the cat­e­go­ry name and per­cent­age there (Fig. 4).

Data Callout  option
Fig. 4 Data Call­out option

If you have dif­fer­ent kind of data, you can change the con­tent of data labels. We just have to click once on the pie chart and press Ctrl + 1 key­board com­bi­na­tion. We will see a table called For­mat Data Labels on the right, where we can select and des­e­lect what we wan to see in the labels (Fig. 5). 

Format Data Labels
Fig. 5 For­mat Data Labels

Some­times, we have to sort our data from largest to small­est or from small­est to largest (Fig. 6).

Data sorting
Fig. 6 Data sorting

Remem­ber that a pie chart is rec­om­mend­ed when you don’t have much infor­ma­tion to show. An opti­mal num­ber is around five pieces of infor­ma­tion. In case you have more, a pie chart will be less readable. 

https://www.youtube.com/watch?v=DMFad6D-6SE

Working hours and wages. Night shifts | Excel Tips #28

When we want to count the num­ber of work­ing hours in Excel, we have z prob­lem with night shifts. Let’ start with a human approach and day shift. 

Work­ing hours and wages. Night shifts | Excel Tips #28

In a day shift, the end time is larg­er that the start time, so we can just sub­tract one num­ber from anoth­er (Fig. 1). 

=(B2-A2)

Subtracting one number from another
Fig. 1 Sub­tract­ing one num­ber from another

After enter­ing and copy­ing down, we can see we have prop­er results for day shifts. In night shifts, when the end time is small­er that the start time, it does’t show us any time, only hash­tags. It hap­pened so because Excel refused to show any neg­a­tive dates or time. Even if Excel showed us neg­a­tive results, they would be wrong (Fig. 2). 

No negative time
Fig. 2 No neg­a­tive time

First, we have to remem­ber that Excel stores time as num­bers, i.e. the part of the day that has passed. When we look at the first hour, which is 8 am, it means that one-third of the day has passed. When we go to the Time bar, and press Gen­er­al, we can see that the time will be giv­en in dec­i­mal num­bers (Fig. 3), (Fig. 4). 

 General Time
Fig. 3 Gen­er­al Time 
Time in decimal numbers
Fig. 4 Time in dec­i­mal numbers

When we want to con­vert Excel time into human time, we have to mul­ti­ply it by 24 (Fig. 5). 

=(B2-A2)*24

Excel time into human time
Fig. 5 Excel time into human time

Now, we can see that the we can eas­i­ly read the val­ues. Remem­ber to have the Gen­er­al option select­ed. There are neg­a­tive val­ues for the night shift. What’s more, they are wrong, as there are only 8 hours from 8 pm to 4 am in row num­ber 3, not 16. 

Negative and wrong results
Fig. 6 Neg­a­tive and wrong results

It means that this human approach won’t work in Excel, so let’ delete the results. What can work here is a func­tion called MOD, which is also quite short. In the MOD func­tion, we also use the human approach, which means that from the end time we sub­tract the start time. How­ev­er, the MOD func­tion needs a divi­sor, i.e. 1, which means that it is one whole day (Fig. 7)

=MOD(B2-A2,1)

Divisor
Fig. 7 Divisor

Now, we can see that our results in day and night shifts are cor­rect. We can final­ly cal­cu­late the wages by mul­ti­ply­ing the num­ber of work­ing hours by the hourly wage (Fig. 8). 

=C2*$F$2

Calculating wages
Fig. 8 Cal­cu­lat­ing wages

As we can see the results are wrong again. Let’s have a look at row num­ber two. There are 8 hours, but Excel does­n’t mul­ti­ply 8 hours times 40$, but one third of a day times 40$, which gives us around $13 (Fig. 9).

Wrong results
Fig. 9 Wrong results

We want to have prop­er wages, so we need to mul­ti­ply it by 24 hours (Fig. 10).

=C2*$F$2*24

Multiplying by 24
Fig. 10 Mul­ti­ply­ing by 24

Now, we have prop­er wages (Fig. 11). 

Proper wages
Fig. 11 Prop­er wages

If you don’t need pre­ci­sion big­ger than 15 min­utes, just use num­bers instead of Excel time. I’m advis­ing it to you from my own experience. 

https://www.youtube.com/watch?v=UTYF245AGRo

VLOOKUP all matches and combine them

Some­times, we want to find all the matched val­ues and com­bine them into one text string, i.e., we want o VLOOKUP all matched val­ues and then com­bine them.

VLOOKUP all match­es and com­bine them

I will give you two solu­tions. The first solu­tion will work from Excel 2019, and the sec­ond one will work in Dynam­ic Array Excel. First of all, we have to check if our rep­re­sen­ta­tive comes from the coun­try we are look­ing at. Let’s take a rep­re­sen­ta­tive from Spain. There is only one rep­re­sen­ta­tive of Spain in our exam­ple. We can check it using the IF func­tion, where we have to cre­ate a prop­er log­i­cal test. We have to take into con­sid­er­a­tion the Coun­try col­umn, so let’s write it by select­ing the col­umn and click­ing the F4 key to lock it. Then, we have to check if the val­ues from the col­umn are equal to just one coun­try (Spain) by click­ing the cell with the name of Spain (D4). It means that cell D4 will be com­pared to each cell from the Coun­try col­umn indi­vid­u­al­ly (Fig. 1)

Comparison to each cell
Fig. 1 Com­par­i­son to each cell

The log­i­cal test will return TRUE only in the case of Spain. In the case of oth­er coun­tries, it will return FALSE. If the log­i­cal test is in an array, we can choose prop­er, cor­re­spond­ing result as a return val­ue. We just need to select an array of the same size, which, in our case, is the Rep­re­sen­ta­tive col­umn. Then, we click the F4 key to lock it. When the log­i­cal test returns FALSE, we want to see an emp­ty text string, so we have to write a space in dou­ble quotes. Let’s close the func­tion with a paren­the­sis (Fig. 2)

=IF($A$2:$A$14=D2,$B$2:$B$14,” ”)

IF function
Fig. 2 IF function

Since I’m work­ing in Dynam­ic Array Excel, Excel spills the results to the whole col­umn (Fig. 3).

IF function results
Fig. 3 IF func­tion results

We can see that we have only one rep­re­sen­ta­tive of Spain, and many emp­ty cells. If we want to find the remain­ing rep­re­sen­ta­tives, we have to join the infor­ma­tion we have. To do that, we can use the TEXTJOIN func­tion, which is avail­able from Excel 2019. We have to give the func­tion a delim­iter. Let’s write a com­ma and a space in dou­ble quotes. Then, we have to decide whether we want to ignore emp­ty cells. We def­i­nite­ly do, so let’s write TRUE, or its short­er ver­sion, which is 1. Then, we just have to close the whole for­mu­la once again (Fig. 4).

=TEXTJOIN(“, “,1,IF($A$2:$A$14=D2,$B$2:$B$14,” ”))

TEXTJOIN function
Fig. 4 TEXTJOIN function

After enter­ing the for­mu­la and copy­ing it down, we have our results (Fig. 5). 

TEXTJOIN function results
Fig. 5 TEXTJOIN func­tion results

When we are in Dynam­ic Array Excel, we can use the FILTER func­tion instead of the IF func­tion. This func­tion just fil­ters our data. Let’s write FILTER func­tion. Our data is locat­ed only in one col­umn, which is the Rep­re­sen­ta­tive col­umn, so we have write the range and lock it with the F4 key. Then, we have to cre­ate an array of the same size with log­i­cal val­ues of TRUE or FALSE. It means that we have to cre­ate the same log­i­cal test as we did with the IF func­tion. Let’s add the Coun­try col­umn (A2:A14), F4 key to lock it, then an equal sign to check whether any of the val­ue from the Coun­try col­umn is equal to Spain (D2). After clos­ing it, we have a ready for­mu­la (Fig. 6).

=FILTER($B$2:$B$14,A$2:$A$14,=D2)

FILTER function
Fig. 6 FILTER function

We can see that Spain has only one rep­re­sen­ta­tive, but Poland has got three (Fig. 7). 

FILTER function results
Fig. 7 FILTER func­tion results

That’s why we have to put our FILTER func­tion results into the TEXTJOIN func­tion. And, once again, we have to write a com­ma and a space in dou­ble quotes. Then, we have to decide that we want to ignore emp­ty cells and close the whole for­mu­la (Fig. 8)

=TEXTJOIN(“, “,1,FILTER($B$2:$B$14,A$2:$A$14=D2))

TEXTJOIN with FILTER function
Fig. 8 TEXTJOIN with FILTER function

We can see that the results in the first solu­tion and in the sec­ond solu­tion are the same (Fig. 9)

Results
Fig. 9 Results

https://www.youtube.com/watch?v=Nc37zUPDm24

Count all cells containing certain text | Excel Tips #27

Some­times, we need to count all cells con­tain­ing cer­tain text. In our exam­ple, it will be a prod­uct name. 

Count all cells con­tain­ing cer­tain text | Excel Tips #27

Let’s assume that we want to count all cells con­tain­ing the name of eggs. In the In the bas­ket col­umn, we have cells where the name of eggs appears at the begin­ning, in the mid­dle, or at the end of the text. Some­times, the cell con­tains only eggs (Fig. 1). 

Eggs in many locations
Fig. 1 Eggs in many locations

In Excel, it’s a sim­ple task because we have the COUNTIF func­tion, where we can use wild­cards. Let’s start writ­ing the func­tion. We have to select a range, which is the In the bas­ket col­umn, F4 to lock it, then let’s write cri­te­ria. If we want to count only cells that con­tain only the word eggs, we would write D2 in the cri­te­ria, how­ev­er, we want to count the cells which con­tain eggs and oth­er prod­ucts as well. That’s why we have to add a wild­card, i.e. an aster­isk (*) that replaces any num­ber of char­ac­ters, even an emp­ty text string. So, we’re putting the aster­isk in dou­ble quotes, then we’re writ­ing an amper­sand to com­bine it with eggs, then D2, where eggs are. As we can see, eggs can be placed also at the end, that’s why we have to com­bine it with anoth­er aster­isk in dou­ble quotes. Our cri­te­ria look as fol­lows (Fig. 2). 

=COUNTIF($B$2:$B$20,”*”&D2&”*”

Our criteria
Fig. 2 Our criteria

When we press the F9 key, we can see how our cri­te­ria real­ly look (Fig. 3). 

=COUNTIF($B$2:$B$20,”*Eggs*”

Our criteria after F9
Fig. 3 Our cri­te­ria after F9

By press­ing Ctrl + Z, let’s return to the pre­vi­ous ver­sion, and close our for­mu­la (Fig. 4). 

=COUNTIF($B$2:$B$20,”*”&D2&”*”)

Our whole formula
Fig. 4 Our whole formula

After enter­ing and copy­ing the for­mu­la down, we can see how many cells con­tain cer­tain prod­uct (Fig. 5). 

Results
Fig. 5 Results

https://www.youtube.com/watch?v=Yv7Uiat–cs

How to create a star rating in Excel

When we want to cre­ate a star rat­ing in Excel, there is at least one pos­si­ble solution.

How to cre­ate a star rat­ing in Excel in 3 minutes

We want to use stars from the Unichars, Uni­code. We just need to use the UNICHAR func­tion and a prop­er uni­code (Fig. 1).

Fig. 1 UNICHAR function

In old­er ver­sions of Excel, copy­ing those stars from the Inter­net should also work. We just have to have the signs we want to repeat. As we can see, we already have num­ber rat­ing. The biggest num­ber is five, and the low­est is zero and there is a prop­er num­ber of stars next to them. Let’s delete them how­ev­er, and start cre­at­ing a prop­er for­mu­la from the begin­ning. We start with the REPT func­tion. We write G4 because our text string is there, then press the F4 key to lock it. When we want to add the num­ber of times we want to repeat, we write C2, which is in the Rat­ing col­umn. Then, we close the for­mu­la (Fig. 2).

=REPT($G$4,C2)

Fig. 2 REPT function

We can copy it down and we have our black stars (Fig. 3). 

Fig. 3 Start rating

How­ev­er, we assumed that we always want to have five stars. It means that if the rat­ing is low­er than five, we have to add some white stars. In such a case, we just have to com­bine one REPT func­tion with anoth­er REPT func­tion using an amper­sand. In the sec­ond REPT func­tion, we have to write G5 and press the F4 key to lock it. In the place on the num­ber of repeats, we have to write five minus C2 - a cell from the Rat­ing column. 

=REPT($G$4,C2) &REPT($G$5,5-C2)

Fig. 4 Two REPT func­tions com­bined with an ampersand 

When we tell the REPT func­tion to repeat zero times, it won’t repeat any­thing, i.e. it will return an emp­ty text string. In the case of a 5‑star rat­ing, we have five stars. How­ev­er, then it comes to a cell with zero, the REPT func­tion treats it the same as an emp­ty cell in most sit­u­a­tions (Fig. 5).

Fig. 5 Star rat­ing results

https://www.youtube.com/watch?v=Apu9OMrSxHA

Highlight weekends with conditional formatting

Some­times, we want to high­light rows of week­ends. In such a case, we can use con­di­tion­al for­mat­ting but, first of all, we have to cre­ate a for­mu­la which will return TRUE for Sat­ur­day and Sun­day, i.e. week­end days. We can start with the WEEKDAY func­tion which will return the num­ber of days in a week (Fig.1).

High­light week­ends with con­di­tion­al formatting

=WEEKDAY(A2)

WEEKDAY function
Fig. 1 WEEKDAY function

We have our results. How­ev­er, this numer­a­tion assigns num­ber 7 to Sat­ur­day, and num­ber 1 to Sun­day. It’s not prop­er from our per­spec­tive. We have to mod­i­fy it by chang­ing the week day num­ber sequence. The best option we can choose is num­ber 1 for Mon­days and num­ber 7 for Sat­ur­days. That’s why we have to write 2 in the sec­ond WEEKDAY func­tion argu­ment (Fig.2).

=WEEKDAY(A2,2)

Selecting the correct option
Fig. 2 Select­ing the cor­rect option

And now, Sat­ur­day is 6 and Sun­day is 7. We can clear­ly see that week­ends are num­bers big­ger that 5 (Fig. 3). 

Weekend bigger that 5
Fig. 3 Week­end big­ger that 5

Now, we can sim­ply cre­ate a log­i­cal test that defines if the week day num­ber is greater than 5 (Fig. 4).

=WEEKDAY(A2,2)>5

A simple logical test
Fig. 4 A sim­ple log­i­cal test

When we copy our for­mu­la down, we can see that we have TRUE for Sat­ur­day and Sun­day, and FALSE for the rest of the days (Fig 5). 

TRUE and FALSE
Fig. 5 TRUE and FALSE

The results are prop­er, but we have to remem­ber that we want to high­light the whole row. We have to ask our­selves how our ref­er­ence should behave. We know that we will be copy­ing the for­mu­la down and to the right (hor­i­zon­tal­ly). What we have to remem­ber is that we always want to look at col­umn A, which is the Date col­umn. Even if we want to go one or two columns to the right, we always want to look at the cell from col­umn A (Fig. 6). 

A cell from column A
Fig. 6 A cell from col­umn A

That’s why, we have to lock the col­umn by press­ing the F4 key, but not the rows. It means that we have to put only one dol­lar sign (Fig. 7). 

=WEEKDAY($A2,2)>5

Locking the column
Fig. 7 Lock­ing the column

When we copy the for­mu­la down, noth­ing changes. But, when we copy it to the right and down, we can see that TRUEs and FALSEs are in a row (Fig. 8).

Rows
Fig. 8 Rows

Now, we have to copy our for­mu­la and the select the range on which we want to add con­di­tion­al for­mat­ting. The range starts with cell A2, so let’s press this cell, then Shift + , two times to the right and Ctrl + Shift + ↓ to the end of our data. Cell A2 has to stay active and we will start cre­at­ing our for­mu­la from the per­spec­tive of this cell (Fig. 10).

Selected range with an active cell
Fig. 9 Select­ed range with an active cell

Now, we go to the Home tab, then to Con­di­tion­al For­mat­ting, and we select the New Rule option (Fig. 10). 

New Rule option
Fig. 10 New Rule option

In the win­dow that will appear, we have to select the Use a for­mu­la to deter­mine which cells to for­mat bar, then paste our for­mu­la into the Edit the Rule Descrip­tion and press the For­mat but­ton (Fig. 11). 

 New Formatting Rule window
Fig. 11 New For­mat­ting Rule window

In the For­mat Cells win­dow, we press the Fill but­ton, then choose the col­or we like. Let’s choose a shade of grey, then the OK but­ton, and the OK but­ton once again in the New For­mat Rule win­dow (Fig. 12).

Fig. 12 For­mat Cells window

Now, we can see that each day of the week­end is high­light­ed the way we want­ed (Fig. 13). 

Fig. 13 High­light­ed weekends

https://www.youtube.com/watch?v=6jhZhEyk64A