Is this Time between Working Hours

How can we check whether the giv­en time is between the work­ing hours or not?

Is this Time between Work­ing Hours 

In our case, work starts at 9:30 AM, and ends at 5:30 PM. Our giv­en time, which is 6:47 isn’t between the work­ing ours. When we change it, we can see that the col­or changed into red and ‘No’ turned into ‘Yes’, which means that now the time is between the work­ing ours (Fig. 1)

Our given time is between the working hours
Fig. 1 Our giv­en time is between the work­ing hours

How­ev­er, when we go to ear­li­er hours we can see that the details changed (Fig. 2)

 Our given time isn't between the working hours
Fig. 2 Our giv­en time isn’t between the work­ing hours

How can we check our time? The sim­plest solu­tion is using the MEDIAN func­tion that returns the val­ue in the mid­dle. Since all our times are in one row, we can just select the range (Fig. 3)

=MEDIAN(B2:D2)

Selecting the whole range
Fig. 3 Select­ing the whole range

If our data is in sep­a­rate cells, we can just add those cells one by one (Fig. 4)

=MEDIAN(B2,C2,D2)

Selecting cells one by one
Fig. 4 Select­ing cells one by one

And just like that we receive the val­ue in the mid­dle. If this val­ue is equal to the giv­en time, it means it’s between the work­ing hours. What’s curi­ous about our medi­an is the fact that it won’t cross our thresh­olds, i.e. our start­ing time and fin­ish­ing time. It means that the small­est val­ue our MEDIAN func­tion can show is the start­ing hour, and the largest is the fin­ish­ing hour (Fig. 5)

The smallest value
Fig. 5 The small­est value

Now, we have to check whether our time is between the work­ing hours. We have to com­pare the func­tion to the giv­en time (Fig. 6)

=MEDIAN(B2,C2,D2)=B2

Comparing
Fig. 6 Comparing 

As we can see, our log­i­cal test returned FALSE (Fig. 7)

FALSE
Fig. 7 FALSE

If the log­i­cal test returns TRUE, it means that the giv­en time is between the work­ing ours (Fig. 8)

TRUE
Fig. 8 TRUE

The answers we have are log­i­cal. Let’s make them more human like by adding the IF func­tion to our MEDIAN log­i­cal test and some sim­ple text like ‘Yes’ and ‘No’ (Fig. 9)

=IF(MEDIAN(B2,C2,D2)=B2,“Yes”,“No”)

Adding the IF function
Fig. 9 Adding the IF function

We can see that we can check whether our giv­en time is between the work­ing ours or no (Fig. 10)

Human answer
Fig. 10 Human answer

https://www.youtube.com/watch?v=IVZIY6-78sc

Named ranges and statistics

Some­times, we need to make many sta­tis­ti­cal oper­a­tions and use many sta­tis­ti­cal func­tions in Excel. How can we do it?

Named ranges and statistics 

A fast and quick solu­tion is using name ranges. For exam­ple, we have the SUM func­tion that sums up all val­ues from Jan­u­ary (Fig. 1)

SUM function
Fig. 1 SUM function

How can we name ranges and use them for our advan­tage? Let’s start with a sim­ple exam­ple of the SUM func­tion. For the SUM func­tion, we have key­board short­cut which is Alt + =. This way Excel will put the sum for Jan­u­ary, which is a range form B2:B6 (Fig. 2)

=SUM(B2:B6)

Alt + = to put the sum
Fig. 2 Alt + = to put the sum

In the exam­ple above we had num­bers. How­ev­er, let’s go to anoth­er sheet where we have no num­bers. When we want to sum the num­bers from the pre­vi­ous sheet, it’s going to be a very tedious job, as we have to move between those two sheets and write prop­er val­ues. What’s more, the ref­er­ence we have while using val­ues form anoth­er sheet isn’t the eas­i­est to under­stand. What we can do is nam­ing the ranges. We just have to select a range in a col­umn and write a prop­er name in the Name Box (Fig. 3).

Naming the range
Fig. 3 Nam­ing the range

Now, when we are using the Alt + = short­cut under our val­ues, Excel will auto­mat­i­cal­ly refer to the Jan­u­ary range, which is B2:B6 (Fig. 4)

=SUM(Jan­u­ary)

Automatic reference
Fig. 4 Auto­mat­ic reference

As we know, Excel remem­bers names. It means that we can use the name in cal­cu­la­tion on a dif­fer­ent sheet. When I start writ­ing “ja” in anoth­er sheet, Excel will sug­gest the range name (Fig. 5). I can just accept it and sum the val­ues from January. 

Excel suggested the range name
Fig. 5 Excel sug­gest­ed the range name

As we can see, nam­ing ranges makes our work faster. We can also name a big­ger group of columns at one time. Just select the group you want. What’s impor­tant, when you’re select­ing your data, you have to select the top rows, and then the num­bers beneath them. Then, go to the For­mu­las tab, click on the Cre­ate from Selec­tion com­mand and select the Top Row check­box in the win­dow that appeared (Fig. 6)

Creating names from selection
Fig. 6 Cre­at­ing names from selection

Now, after we named our ranges, we can see that the Feb­ru­ary range is named Feb­ru­ary, the March range is named March and so on. When we move to anoth­er sheet, we can use those names (Fig. 7)

Excel is suggesting the new names
Fig. 7 Excel is sug­gest­ing the new names

How­ev­er, we can go one step fur­ther using the ref­er­ence to names. I have Jan­u­ary in cell B1. But, when I refer to cell B1, Excel won’t sim­ply con­vert the text from cell B1 to a range because it just text. It means that our func­tion won’t add any­thing. First of all, we have to lock the rows (B$1), then add the INDIRECT func­tion to our cal­cu­la­tion. Now, the INDIRECT func­tion changes the text into a ref­er­ence to the prop­er range (Fig. 8)

=SUM(INDIRECT(B$1))

INDIRECT function
Fig. 8 INDIRECT function

Now, when I drag the for­mu­la to the right, I will have sums from each indi­vid­ual month (Fig. 9)

=SUM(INDIRECT(F$1))

Sum from individual months
Fig. 9 Sum from indi­vid­ual months

When I copy the for­mu­la one cell low­er, I’m just chang­ing SUM into AVERAGE (Fig. 11)

=AVERAGE(INDIRECT(B$1))

SUM into AVERAGE
Fig. 1 SUM into AVERAGE

After I drag it to the right, I have prop­er results. I do the same with the remain­ing rows (Fig. 12)

=MIN(INDIRECT(B$1))

Changing the remaining names
Fig. 12 Chang­ing the remain­ing names

This way, we can quick­ly add more sta­tis­ti­cal oper­a­tions for many months using prop­er name ranges and the INDIRECT function. 

https://www.youtube.com/watch?v=E9APUsy4y‑E

Cubic root, square root and nth root

Some­times, we need to cal­cu­late a cubic root, square root or an nth root of a num­ber. How can we do that?

Cubic root, square root and an nth root

First of all, we can use the SQRT func­tion to cal­cu­late a square root (Fig. 1)

=SQRT(A3)

SQRT function
Fig. 1 SQRT function

And here we have our results. There is also the POWER func­tion used for cal­cu­lat­ing the square root with the use of inverse num­bers. The num­ber for a square root is 1 divid­ed by 2 (1/2). (Fig. 2)

=POWER(A3,1/2)

POWER function
Fig. 2 POWER function

As we can see the results are the same. We can even use a sim­ple sym­bol of rais­ing a num­ber to a pow­er. In the case of a cubic root it will be the num­ber from cell A3 (2), then a caret (Shift + 6). Then, the reverse of a cubic, which is 1/3 writ­ten in a paren­the­sis (Fig. 3)

=A3^(1/3)

Cubic root
Fig. 3 Cubic root

And we have our cubic roots. In the case of the fourth root, we will use the same cal­cu­la­tion, which is a caret and, this time, 1/4 (Fig. 4)

=A3^(1/4)

Fourth root
Fig. 4 Fourth root

And we have our fourth root. In the case of the tenth root, I can even write this num­ber as 0.1 (Fig. 5)

=A3^0.1

Tenth root
Fig. 5 Tenth root

And, just like that we have our tenth root (Fig. 6)

Final results
Fig. 6 Final results

Depend­ing on the sit­u­a­tion, use the cal­cu­la­tion you under­stand the most. 

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

Population Pyramid Chart

Some­times, we need to insert a pop­u­la­tion pyra­mid in Excel or a chart com­par­ing two values. 

Pop­u­la­tion Pyra­mid Chart

One part of the chart is on the left, while the oth­er is on the right. In order to cre­ate some­thing like pop­u­la­tion pyra­mid we have to insert a prop­er chart. I’m using data from Poland as I’m an Excel lover from Poland. We have to have one part of neg­a­tive val­ues, which will go to the left side of the chart. If you want to do it, you have to write ‑1 in one cell, then copy it and select all val­ues where we want to change the sign, then use the Paste Spe­cial option (or use the Alt + Ctrl + V short­cut). In the Paste Spe­cial win­dow, select the Val­ues radio but­ton and the Mul­ti­ply radio but­ton in the Oper­a­tion sec­tion. It means that we will be mul­ti­ply­ing ‑1 by the select­ed val­ues (Fig. 1)

Paste Special window
Fig. 1 Paste Spe­cial window

Now, we have neg­a­tives and pos­i­tives, which is the left and the right side of our chart. We can insert the chart. Let’s select one cell and go to the Insert tab and find the Clus­tered Bar option (Fig. 2)

Clustered Bar option
Fig. 2 Clus­tered Bar option

The chart that appeared isn’t good enough for us. The first mod­i­fi­ca­tion we want to imple­ment is chang­ing the title. Let’s write ‘Pop­u­la­tion Pyra­mid’ (Fig. 3)

Chart Title change
Fig. 3 Chart Title change

I also want to mod­i­fy bars. Let’s click on them, then press Ctrl +1. For­mat Data Series win­dow will appear where we have to select 100% in the Series Over­lap sec­tion and set the Gap Width to 10% (Fig. 4)

Series Overlap and Gap Width options
Fig. 4 Series Over­lap and Gap Width options

Now, the bars are larg­er. The next thing is the Ver­ti­cal Axis. Click Ctrl + 1 short­cut and go to the Labels tab. Set the Label Posi­tion to Low which, in our case, is the left side. In the Spec­i­fy inter­val unit let’s leave 1 (Fig. 5) 

Label Position and Specify Interval Unit options
Fig. 5 Label Posi­tion and Spec­i­fy Inter­val Unit options

Now, the chart looks much bet­ter, but I don’t like the ver­ti­cal lines here. Let’s click it and press the Delete key (Fig. 6)

Vertical lines not needed
Fig. 6 Ver­ti­cal lines not needed

The next thing we want to change is the hor­i­zon­tal axis where we have per­son val­ues. It means that we don’t need any neg­a­tive val­ues. We have to select it, press Ctrl + 1, then in the For­mat Axis win­dow, we need to go to the Num­bers bar. In the For­mat Code bar, we need to repeat the per­cent code for the neg­a­tive val­ues. Let’s add a semi­colon, then write 0.00% with­out any minus sign. Then, we click on the Add but­ton (Fig. 7)

Format Code bar
Fig. 7 For­mat Code bar

Now, we have pos­i­tive val­ues on the left and on the right side of the chart. What I’m still miss­ing is Data Labels. We have to press the plus sign and select the Data Labels check­box (Fig. 8)

Adding Data Labels
Fig. 8 Adding Data Labels

We can see that the label font is too big. Let’s make it small­er by select­ing the labels and chang­ing the font size on the rib­bon (Fig. 9)

Changing the font size
Fig. 9 Chang­ing the font size

There is still one more thing we need to change. There are minus signs on the left side of the chart. So, let’s press the Ctrl + 1 short­cut and go to the For­mat Data Labels win­dow. We have to open the Num­ber tab and write the per­cent­age once again. We sep­a­rate the per­cent­ages with a semi­colon, so that the per­cent­age from the left side cor­re­sponds to the left part of the chart, and the right cor­re­sponds to the right part. Then, we press Add (Fig. 10)

Two percentages
Fig. 10 Two percentages

In the end, I want to change the posi­tion of the leg­end. Let’s select the leg­end and press Ctrl + 1. We can see many options con­cern­ing the posi­tion of the leg­end (Fig. 11)

Legend Positions
Fig. 11 Leg­end Positions

How­ev­er, I want to change the posi­tion man­u­al­ly. Let’s drag it to the right and change its size. We can also change the size of the bars. There are many more mod­i­fi­ca­tions that you can imple­ment. My Pop­u­la­tion Pyra­mid is fin­ished and looks as fol­lows (Fig. 12)

 Finished Population Pyramid
Fig. 12 Fin­ished Pop­u­la­tion Pyramid

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

Add degree sign (°C) to numbers

Some­times, we want to add a degree sign to num­bers. How can we do it? 

Add degree sign (°C) to numbers

Let’s say we want to show tem­per­a­ture in degrees Cel­sius or Fahren­heit. The first thing we want to do is insert­ing the cor­rect sign. We can either copy it from the inter­net or we can choose the Sym­bol com­mand from the Insert tab (Fig. 1). 

Adding a symbol
Fig. 1 Adding a symbol

In the Sym­bol win­dow that appears, we’re choos­ing the Latin‑1 Sub­set (1), then the Degree Sign, whose name we can see at the bot­tom of this win­dow. We click the Insert and Close but­tons (Fig. 2). 

Symbol window
Fig. 2 Sym­bol window

We can see the Degree Sign in cell D1. After adding C, we have the full sym­bol. Now, we can copy the sym­bol in the edit mode, then select all cells with num­bers to which we want to add the sign. Then, we press the Ctrl + 1 short­cut. In the For­mat Cells win­dow we’re choos­ing the Cus­tom Cat­e­go­ry, then we’re choos­ing 0 and we can paste the °C sign. In the Sam­ple bar we can pre­view what our final text will look like in the end. If we want to make sure that our text will be show as a text in the end, we can write it in dou­ble quotes. In this case, it’s a bul­let­proof solu­tion (Fig. 4). 

Format cells window
Fig. 4 For­mat cells window

And we have our signs cor­rect­ly insert­ed (Fig. 5). 

Final results
Fig. 5 Final results

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