Excel SORT Function

Today, we want to learn how the SORT func­tion works in Excel. 

Excel SORT Function

The SORT func­tion is avail­able from Dynam­ic Array Excel, which is around 2021. Let’s start with the sim­plest ver­sion of the SORT func­tion, where we only need to write an array. We have to remem­ber that the array must be giv­en with­out head­ers. Let’s select our data and put it as an argu­ment and let’s put our for­mu­la into a cell (Fig. 1)

=SORT(A2:C169)

SORT function
Fig. 1 SORT function

And we have the results. The most impor­tant thing about for­mu­las in Dynam­ic Array Excel is that they spill. It means that our for­mu­la is in only one cell, but the results spill. The for­mu­la is only in cell E2, but when we click on cell E3, we can see that the for­mu­la is grayed out in the for­mu­la bar. It means that it con­tains results of this func­tion, but does­n’t con­tain the func­tion itself (Fig. 2)

Formula grayed out
Fig. 2 For­mu­la grayed out

When we add an array with data to be sort­ed, Excel’s sort­ing will be based on the first col­umn, which is the col­umn with dates. In the sort­ed array we don’t see dates but num­bers because Excel does­n’t know how to copy the for­mat­ting in array for­mu­las. If we want to have prop­er for­mat­ting, we can copy the for­mat­ting using the For­mat Painter (2) from the Home tab (1). We will also high­light the cell with the for­mu­la (3) (Fig. 3)

Using the Format Painter command
Fig. 3 Using the For­mat Painter command

Now, our results are for­mat­ted. Since we sort­ed by the first col­umn, our results are basi­cal­ly the same as in our orig­i­nal col­umn. To change that, we can add the sec­ond argu­ment to our SORT func­tion, which is the sort index. It’s the num­ber of a col­umn by which we want to sort our data. Let’s write 2, mean­ing the sec­ond col­umn (Fig. 4)

=SORT(A2:C169,2)

SORT formula with the second argument
Fig. 4 SORT for­mu­la with the sec­ond argument

We can see that the sort­ing has changed. Now, we can see that only Chan­dlers are at the top because it’s an ascend­ing sort­ing. This way we can sort by any col­umn. Let’s move on to the third argu­ment, which is the sort order. Let’s change it to a descend­ing sort­ing by writ­ing ‑1 (Fig. 5)

=SORT(A2:C169,2,-1)

Descending sorting
Fig. 5 Descend­ing sorting

Now, the first sales­man in Ross. Let’s add some­thing more. Let’s sort by Sales from the largest to the small­est. Now, the sales are writ­ten ran­dom­ly in the Sales col­umn. We can add the third col­umn to the sec­ond argu­ment. We can also add a ref­er­ence to cells where num­bers of columns are writ­ten. It’s very impor­tant to write them in the cor­rect order. In our case the first cell from the top con­tains 2 and the sec­ond one con­tains 3. It means that first, we will sort by the sec­ond col­umn, and then by the third col­umn (Fig. 6)

Adding a cell reference
Fig. 6 Adding a cell reference

And we have the results. We can see that Ross is sort­ed by val­ues in the Sales col­umn. The same is with the rest of the sales­men. Now, let’s focus on the third argu­ment once again. We have two columns of sort­ing in the sec­ond argu­ment, but only one num­ber (-1) in the third argu­ment which is the sort order. It means that the sort­ing is descend­ing for each col­umn. When we want to have an ascend­ing order for one col­umn and a descend­ing order for anoth­er col­umn, we can do the same as we did with the sec­ond argu­ment. We have to refer to some cells in Excel. In our case we have a sort­ing order for each col­umn (Fig. 7)

Referring to other cells
Fig. 7 Refer­ring to oth­er cells

Now, we have an ascend­ing sort­ing for the Sales­man col­umn, and a descend­ing sort­ing for the Sales column. 

When we don’t want any addi­tion­al cells in our sheet, we can hard code them in the for­mu­la by press­ing F9 key. It changes the argu­ment into an array. We can do the same with the sort order argu­ment. When we look at the for­mu­la now, we can see that the sec­ond col­umn in ascend­ing, and the third col­umn is descend­ing (Fig. 8)

Hard coding the values
Fig. 8 Hard cod­ing the values

Now that we have every­thing we need­ed, we can can­cel the unnec­es­sary cells. We don’t even need the third argu­ment, as it is reserved for hor­i­zon­tal sort­ing. Here, we are sort­ing only by columns, so we can leave it like that. Here are our results (Fig. 9)

Results
Fig. 9 Results

https://www.youtube.com/watch?v=RzxTurQaF5I&t

Compare 2 lists — Legacy Excel classic formulas

Today, we want to com­pare two lists and find ele­ments that are on both lists as well as on only one. 

Com­pare 2 lists clas­sic for­mu­las Lega­cy Excel

We are going to use Clas­sic Excel, Lega­cy Excel and a clas­sic for­mu­la with the AGGREGATE func­tion. It means that this for­mu­la will work from 2010 and thanks to this, we won’t need to use the Crtl + Shift + Enter key combination.

Let’s start with find­ing ele­ments. We will be check­ing whether ele­ments from My son’s favorite movies list are on My daugh­ter’s favorite movies list. We can use the MATCH func­tion here. We are look­ing up ele­ments from my son’s list (list B) on my daugh­ter’s list (list A). We’re click­ing F4 key to lock both lists. Then we write zero to have the exact match and that’s it (Fig. 1)

=MATCH($C$2:$C$9,$A$2:$A$11,0)

MATCH function
Fig. 1 MATCH function

Excel has just giv­en us the results. I have the Dynam­ic Array Excel, which means that Excel spilled the results. We can see that How to train a Drag­on is in list B with num­ber 5 which means that it’s on posi­tion num­ber 5 in list A. We also have Spi­der-man on posi­tion num­ber 7. If we want to extract those num­bers, we have to use the AGGREGATE func­tion. In the first argu­ment of the func­tion, we have to use a func­tion num­ber 15, as this func­tion under­stands an array for­mu­la. Then, in the sec­ond argu­ment, we have to write 6 to ignore errors. At the end, in the k argu­ment let’s write ROWS from E2 to E2 and press F4 key to lock only the first one. This will allow the for­mu­la to expand while copy­ing down (Fig. 2)

=AGGREGATE(15,6,MATCH($C$2:$C$9,$A$2:$A$11,0),ROWS($E$2,E2))

AGGREGATE function
Fig. 2 AGGREGATE function

Now, we have the results, how­ev­er there are some errors. To remove that, we can add the INDEX func­tion and write list A in the first argu­ment, then press F4 key to lock it (Fig. 3)

=INDEX($A$11:$A$11,AGGREGATE(15,6,MATCH($C$2:$C$9,$A$2:$A$11,0),ROWS($E$2,E2))

INDEX function
Fig. 3 INDEX function

Now, we have the ele­ments that are on both lists. We can remove the errors. Let’s add the IFERROR func­tion (Fig. 4)

=IFERROR(INDEX($A$11:$A$11,AGGREGATE(15,6,MATCH($C$2:$C$9,$A$2:$A$11,0),ROWS($E$2,E2))),“”)

IFERROR function
Fig. 4 IFERROR function

We have our results in the tar­get list, and there is still some back­up space in case we have some more results (Fig. 5)

Results with extra space
Fig. 5 Results with extra space

Now, we can cre­ate a for­mu­la that will look up ele­ments only from list B. Let’s start with giv­ing each ele­ment a num­ber. We’ll use the ROW func­tion here and write the whole list as the first argu­ment. Then F4 key to lock it (Fig. 6)

=ROW($C$2:$C$9)

ROW function
Fig. 6 ROW function

As we can see, Excel has spilled the results and each ele­ment has got its own num­ber. How­ev­er, we want to start from 1, not from 2 (Fig. 7)

Numbers for each element
Fig. 7 Num­bers for each element

To do this, we have to sub­tract the head­er row and press F4 key to lock it (Fig. 8)

=ROW($C$2:$C$9)-ROW($C$1)

Subtracting the header row
Fig. 8 Sub­tract­ing the head­er row

And we have all ele­ments num­bered from 1 to 8. Now, we want only num­bers of ele­ments that aren’t on list A. How can we do it? We can divide our list by the MATCH func­tion. In the first argu­ment, we write list B and press F4 key to lock it, then list A in the sec­ond argu­ment, as that’s the place where we will be look­ing up our val­ues. Then F4 key. As the final step, we write 0, as we want to have the exact match and the look­ing up process will start from the top (Fig. 9)

=(ROW($C$2:$C$9)-ROW($C$1))/MATCH($C$2:$C$9,$A$2:$A$11,0)

Dividing the list
Fig. 9 Divid­ing the list

Just like that we have num­bers only on those posi­tions that are on both lists. How­ev­er, we want a reverse sit­u­a­tion, where we will have num­bers in #N/A posi­tions. To to that we have to put our MATCH func­tion into the ISNA func­tion (Fig. 10)

=(ROW($C$2:$C$9)-ROW($C$1))/ISNA(MATCH($C$2:$C$9,$A$2:$A$11,0))

ISNA function
Fig. 10 ISNA function

If the MATCH func­tion returns an error, the ISNA func­tion will change this error into TRUE. And a num­ber divid­ed by the val­ue of TRUE will change the TRUE val­ue into 1. If the ISNA func­tion returns FALSE, the math­e­mat­i­cal oper­a­tion will change FALSE into 0. Since we can­not divide by 0, we will have #DIV/0! errors (Fig. 11)

#DIV/0! errors
Fig. 11 #DIV/0! errors

Since we have a list with num­bers which are the posi­tions of ele­ments we want to extract and errors, it’s time to put our whole for­mu­la into the AGGREGATE func­tion. Just like before, we start from the small­est val­ue, so let’s write 15, then 6, as we want to ignore errors. At the end of our func­tion, we write the ROWS func­tion with G2 cell. Then F4 key to lock the first one (Fig. 12)

=AGGREGATE(15,6,(ROW($C$2:$C$9)-ROW($C$1))/ISNA(MATCH($C$2:$C$9,$A$2:$A$11,0)),ROWS($G$2:G2))

 AGGREGATE function
Fig. 12 AGGREGATE function

Now, we have posi­tions with­out errors, which means that we can add the INDEX func­tion to our for­mu­la. As we take posi­tions from list B, we have to select the list, then press F4 key to lock it (Fig. 13)

INDEX function
Fig. 13 INDEX function

After press­ing Enter, or Ctrl + Enter, we have our results. Now, we can add the IFERROR func­tion to put emp­ty text strings in the places where the for­mu­la returns errors (Fig. 14)

=IFERROR(AGGREGATE(15,6,(ROW($C$2:$C$9)-ROW($C$1))/ISNA(MATCH($C$2:$C$9,$A$2:$A$11,0)),ROWS($G$2:G2)),“”)

IFERROR function
Fig. 14 IFERROR function

And we have our results (Fig. 15)

Results
Fig. 15 Results

This way, we have two for­mu­las. The first one to extract ele­ments that are on both lists, and the sec­ond one to extract ele­ments that are only on one list. 

https://www.youtube.com/watch?v=gb7zo6lPZSs&t

Compare 2 lists — Dynamic Array formula

Today, we want to com­pare two lists. Being more pre­cise, we want to find ele­ments that are on both lists, as well as ele­ments that are only on one list. 

Com­pare 2 lists dynam­ic array formula

This time, we will use Dynam­ic Array for­mu­las. It makes the oper­a­tion eas­i­er than using Lega­cy Excel formulas. 

We’re start­ing with the XMATCH func­tion. In the first two argu­ments, we write a list of ele­ments that we are look­ing for, and the list that those ele­ments are looked up in (Fig. 1)

=XMATCH(C2:C9,A2:A11)

XMATCH function
Fig. 1 XMATCH function

In the results, we can see that we have #N/A errors in the places where Excel did­n’t find any match, and num­bers where it found the prop­er match (Fig. 2)

Errors and matches
Fig. 2 Errors and matches

Now, we want to extract the val­ues where Excel has found the match. To to this, we can add the ISNUMBER func­tion to the XMATCH func­tion (Fig. 3)

=ISNUMBER(XMATCH(C2:C9,A2:A11))

 ISNUMBER function added to XMATCH function
Fig. 3 ISNUMBER func­tion added to XMATCH function

Now, our results are FALSEs and TRUEs. What we can do now, is add the FILTER func­tion. In the first argu­ment, we have to write the array with ele­ments that we are look­ing for (Fig. 4)

=FILTER(C2:C9, ISNUMBER(XMATCH(C2:C9,A2:A11))

FILTER function
Fig. 4 FILTER function

And we have our results. Now, we want to find ele­ments that are only on the My son’s list. All we need to do, is take the same for­mu­la and change the ISNUMBER func­tion into ISNA func­tion (Fig. 5)

=FILTER(C2:C9, ISNA(XMATCH(C2:C9,A2:A11))

ISNUMBER function into ISNA function
Fig. 5 ISNUMBER func­tion into ISNA function

And just like that we have found ele­ments that are on both lists and ele­ments that are only on one list (Fig. 6)

Results
Fig. 6 Results

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

Calculating the age based on the date of birth

Today, we want to cal­cu­late the age bas­ing on the date of birth.

Cal­cu­lat­ing the age based on date of birth

It’s a real­ly sim­ple task. We just want to know one hid­den func­tion. It’s called DATEDIF. Excel won’t show its syn­tax, but it will cal­cu­late it prop­er­ly, if we give it prop­er argu­ments. The first argu­ment of this func­tion is the start date, which is our date of birth. The sec­ond argu­ment is the TODAY func­tion. The last argu­ment is ‘Y’, as we want to cal­cu­late whole years (Fig. 1)

=date­dif(A2,TODAY(),“Y”)

Whole formula
Fig. 1 Whole formula

And just like that, we have cal­cu­lat­ed the age bas­ing on the date of birth (Fig. 2)

Results
Fig. 2 Results

How to Add a Target Line to an Excel chart

Today, we want to learn how to add a Tar­get Line to our chart and con­trol it. 

How to Add a Tar­get Line to an Excel chart

Some­times, we want to low­er the line, some­times we want to raise it. But, firs things first. 

Let’s start with writ­ing the tar­get. Let’s write 700. Then, we have to cre­ate a sim­ple for­mu­la with­out any dol­lars in the first cell below (Fig. 1)

=C2

A simple formula
Fig. 1 A sim­ple formula

Now, we can copy the for­mu­la down. And what’s hap­pened? Each cell is refer­ring to the cell above it. At the end, they are going to the first cell (Fig. 2)

 Each cell refers to the cell above
Fig. 2 Each cell refers to the cell above

It means that when we change the val­ue in the first cell, the val­ues in the cells below also change (Fig. 3)

Values changed
Fig. 3 Val­ues changed

Now, when our data is prop­er­ly pre­pared, we can select the whole data, go to the Insert tab (1), then go to Charts and choose the col­umn chart option (2) (Fig. 4)

Creating a chart
Fig. 4 Cre­at­ing a chart

We have a chart but no line. To cre­ate one, we have to select the Tar­get series, go to the Insert tab (1), and choose a line chart from the Charts area (2) (Fig. 5)

Creating a line
Fig. 5 Cre­at­ing a line

When we have the line, we can right-click it and choose the Change Series Chart Type option from the pop-up menu (Fig. 6)

Changing the chart type
Fig. 6 Chang­ing the chart type

In the win­dow that has appeared, we can change the chart type to any we like (Fig. 7)

Chart type options
Fig. 7 Chart type options

How­ev­er, we have already cho­sen the type we want­ed. Let’s change the val­ue in the first cell in the Tar­get col­umn. What we can see is that the line has changed its posi­tion (Fig. 8)

Value change
Fig. 8 Val­ue change

We can also cal­cu­late the aver­age of our data using the AVERAGE func­tion (Fig. 9)

=AVERAGE(B2:B13)

Calculating the average
Fig. 9 Cal­cu­lat­ing the average

Now, we have an aver­age line for our data (Fig. 10)

 An average line
Fig. 10 An aver­age line

https://www.youtube.com/watch?v=w5cwLRB-YyY

Target Chart with Unique targets 

Today, we want to learn how to cre­ate a chart on which we have unique tar­gets for each month, group, shop, etc. 

Tar­get Chart with Unique targets

The most impor­tant task for us is to cre­ate prop­er data. When we do it in the right way, the rest will be much sim­pler. Let’s start with cre­at­ing a Base series, which will be the foun­da­tion of our chart. We have to check if the income is larg­er than the tar­get. It means that we have to make a log­i­cal test with the IF func­tion. If it’s cor­rect, we want the small­er val­ue, which is the tar­get val­ue. In the oth­er case, we want the income (Fig. 1)

=IF(B2>C2,C2,B2)

IF function for the Base series
Fig. 1 IF func­tion for the Base series

And just like that, we have our foun­da­tion. Now, we can move on to the next step. If the income is larg­er than the tar­get, we want to know how much larg­er it is. We will cre­ate it in the Upper col­umn. We start with the IF func­tion again, and we are check­ing if the income is larg­er than the tar­get. If so, we want to deduct the tar­get from the income. In the oppo­site case, we want noth­ing, i.e. we want our chart to show noth­ing. It means that we can­not write just an emp­ty text string in the for­mu­la in two dou­ble quotes. We have to return an error. The sim­plest way I know is using the NA func­tion (Fig. 2)

IF function for the Upper series
Fig. 2 IF func­tion for the Upper series

And just like that, we have our Upper series. The last thing to do is the Low­er series. It is very sim­i­lar to the pre­vi­ous for­mu­la, All we need to change is the ‘larg­er than’ sign into ‘small­er than’ sign, and deduct the income from the tar­get (Fig. 3)

IF function for the Lower series
Fig. 3 IF func­tion for the Low­er series

Just like that, we have the sec­ond series. 

Now, when we have a val­ue in one of the Upper cells, we will have an error in the same row in the Low­er cell, and vice ver­sa. When our data looks OK, we can move on to insert­ing a chart. We have to select the Months col­umn, as well and the Base, Upper and Low­er series. Then, we go to the Insert tab (1), then to the bar chart, where we select the Stacked Column option (2) (Fig. 4)

Creating a stacked column
Fig. 4 Cre­at­ing a stacked column

Now, we have all we need. We have our Base. When our income is larg­er than the tar­get, we have a blue part, and when we did­n’t reach the tar­get, we have green. Let’s change the col­ors, so that the dif­fer­ences are more vis­i­ble. I also don’t like the hor­i­zon­tal lines, so let’s delete them by select­ing them and click­ing the Delete key. I will also widen the columns by select­ing them and press­ing Ctrl + 1. In the For­mat Data Series win­dow on the right we can change the Gap Width to 70% (Fig. 5)

Gap Width option
Fig. 5 Gap Width option

Now, I want to add our tar­get. Since we have only col­umn charts here, we can copy our tar­get col­umn, select the chart and press Ctrl + V. Now, we have our tar­get, how­ev­er, we don’t want to have anoth­er col­umn. We can change it into a line chart with marks. We can do it by right-click­ing on the tar­get series in the chart. In the pop-up menu, we have a Change Series Chart Type option (Fig. 6)

Change Series Chart Type option
Fig. 6 Change Series Chart Type option

In the Change Chart Type win­dow, we can change our tar­get by click­ing on prop­er options (Fig. 7)

Line with Markers option
Fig. 7 Line with Mark­ers option

How­ev­er, there is one more option. We can go to the Insert tab, and when the series is select­ed, we choose a prop­er chart. The result is the same (Fig. 8)

Line with Markers option
Fig. 8 Line with Mark­ers option

Now, we have to select our line with mark­ers, then press Ctrl + 1 to open the For­mat Data Series win­dow. When our line chart is select­ed, we have to go to the buck­et part, and select the No line option in the Line part (Fig. 9)

No line option
Fig. 9 No line option

In the Marker part, we can use some built-in mark­ers, like a line. How­ev­er, when I’m using the line, it’s too thick for me, espe­cial­ly in a big­ger size (Fig. 10)

 Bigger size
Fig. 10 Big­ger size 

In such a case, we can do anoth­er trick. Let’s go to the Insert tab (1), then the Shape part (2), and select a sim­ple Line (3) (Fig. 11)

Line option
Fig. 11 Line option

Now, while hold­ing the Shift key, we can draw a line with our mouse (1), and mod­i­fy it (2) (Fig. 12)

Line modification
Fig. 12 Line modification

Now, we can copy the line, then select mark­ers and paste it. I can see that my line isn’t long enough, so i’ll just make it longer, then paste it once again (Fig. 13)

Longer line
Fig. 13 Longer line

Now, let’s insert data labels. In the Chart Ele­ments win­dow we have to select the Data Labels option. Excel,then will give me data labels for each series (Fig. 14)

Chart elements window
Fig. 14 Chart ele­ments window

How­ev­er, I don’t want data labels for the tar­get series, so I have to select it and just delete it. Now, It’s impor­tant that we have data labels for our upper part only when there is an upper part. In places with errors, there won’t be data labels. The same is with low­er parts. Errors won’t show any­thing on the chart. Let’s change low­er data label col­or by going to the Home tab and select­ing white (Fig. 15)

Color change
Fig. 15 Col­or change

Let’s add the chart title. Let it be the con­tend of cell B1. We write = in the for­mu­la bar, then click the cell and press Enter (Fig. 16)

=‘E061’!$B$1

Chart title
Fig. 16 Chart title

There is one more thing. I some­times don’t want to show the tar­get series in the leg­end. To remove it, we have to click on the leg­end, then once more on the tar­get series in the leg­end, then press Delete (Fig. 17)

Final chart
Fig. 17 Final chart

Now, I’m hap­py with my chart with unique tar­get for months, groups, shops, etc. 

https://www.youtube.com/watch?v=_UmfRhNT9v4&t

Creating a Column Chart 

Today, we want to learn how to insert a bar or a col­umn chart in Excel.

Cre­at­ing a Col­umn Chart 

For a start, we can select a cell in our dataset. We can also select the whole set. Then, we go to the Insert tab and choose a prop­er chart. I per­son­al­ly like 2 D columns, so I’ll select it (Fig. 1)

Selecting a 2 D column chart
Fig. 1 Select­ing a 2 D col­umn chart

And just like that, we have our chart. We can mod­i­fy its size by drag­ging the bor­ders. When you drag the chart hold­ing the Alt key at the same time, Excel will match the size of the chart to cell bor­ders, which is a nice trick. 

Now, that we have our chart, let’s change the way it looks. Let’s go to the Chart Design tab and choose one from the Chart Styles (Fig. 2)

 Selecting a proper chart style
Fig. 2 Select­ing a prop­er chart style

We can also decide what indi­vid­ual chart ele­ments we want to change. If we want to delete hor­i­zon­tal lines, we can just click on them once, and press the Delete but­ton. If we want to have wider columns, we have to click on them, then press Ctrl + 1, which will open the For­mat Data Series win­dow, where we can change the Gap Width. Let’s change it to 55 %. Now it looks good (Fig. 3)

Gap Width to 55%
Fig. 3 Gap Width to 55%

I will also add data labels. Let’s go to the Chart Ele­ments (1) , and choose Inside End Data Labels (2) (Fig. 4)

Inside End Data Labels
Fig. 4 Inside End Data Labels

Now, let’s change the font col­or into white. You can find this option in the Home tab (1) , in the Font area (2) (Fig. 5)

Font color
Fig. 5 Font color

And just like that we’ve cre­at­ed a col­umn chart. When we change some val­ues in our dataset, our val­ues in the chart will also change (Fig. 6)

Value modification
Fig. 6 Val­ue modification

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

Step Chart

Today, we want to learn how to cre­ate a step chart in Excel. 

Step chart

This task is real­ly sim­ple. All we have to know is one, sim­ple trick. Our dataset has got two columns. One with dates and one with num­bers. Let’s copy the set so that we can leave the orig­i­nal one as it is and paste it next to it. Now, let’s copy the orig­i­nal set once more, but this time with­out head­ers and paste it just under the new one. Now, we have to delete two cells using the Shift cells up option. Let’s right-click on the first cell in the first col­umn and choose the Delete option. It will take us to the Delete win­dow, where we have to select the Shift cells up radio but­ton (Fig. 1)

Shift cells up option
Fig. 1 Shift cells up option

Let’s do the same with cell E10, but this time using the Crtl + - short­cut, which will take us straight to the Delete win­dow (Fig. 2)

Delete window
Fig. 2 Delete window

After remov­ing those two cells, we have our dataset pre­pared for the step chart. Now, let’s select one cell in our dataset with dates, then go to the Insert tab (1), then select the Line Chart with Mark­ers option (3) (Fig. 3)

Line with Markers option
Fig. 3 Line with Mark­ers option

I chose a line with mark­ers to show that almost each date has got two points. It means that there is a straight hor­i­zon­tal or ver­ti­cal line from one day to another.

From this point on, we can mod­i­fy our chart if we need to, how­ev­er our basic step chart is ready (Fig. 4)

Basic step chart
Fig. 4 Basic step chart

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

Milliseconds and Hundredths of a second

Today, we want to learn how to show a hun­dredth of a sec­ond or a mil­lisec­onds in Excel. 

Mil­lisec­onds and Hun­dredths of a second

Let’s start by writ­ing our time in a cell. Let’s assume that we want 0 min­utes, 12 sec­onds and 45 mil­lisec­onds. Let’s enter it in our cell. We can see that we have two places for min­utes and only one dig­it after it. It’s not a hun­dredth of a sec­ond, but it’s only a start­ing point. Since we’re work­ing with time, a sim­ple Increase Dec­i­mal option wont’ work here, as they’re not real num­bers. Let’s press Ctrl + 1. It will take us to the For­mat Cells win­dow. We are in the Num­ber tab, Cus­tom Cat­e­gory, where the cus­tom for­mat is mm.ss.0. We can see that the dec­i­mal part is only one 0 (Fig. 1) 

Time format
Fig. 1 Time format

Let’s add two more zeros. Three zeros is the max­i­mum num­ber of dec­i­mal places for time (Fig. 2)

Three zeros
Fig. 2 Three zeros

Now, we have more pre­cise time (Fig. 3)

Precise time
Fig. 3 Pre­cise time

We can do the same with oth­er cells. We can even add hours (Fig. 4)

Adding hours
Fig. 4 Adding hours

How­ev­er, in our case we don’t need it. Let’s test our set­ting and write 00:45.670 in the next cell, and 00:00.001 in anoth­er one. We can see that Excel is show­ing the time pre­cise­ly. Now, let’s add it all up and check if the result is also pre­cise (Fig. 5)

=SUM(C2:C5)

 Summing up
Fig. 5 Sum­ming up

Here we go, the time is pre­cise also in this case. 

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

How to add a trendline to a chart

Today, we want to learn how to add a trend­line to a chart. 

How to add a trend­line to a chart

It’s a real­ly sim­ple task. We just have to select our chart, then press the green plus sign (Chart Ele­ments) and go to the Trend­line option. We can see that there are many types of trend­lines, start­ing from Lin­ear. Let’s use it (Fig. 1)

Linear option
Fig. 1 Lin­ear option

We can see that the trend­line is of the same col­or as our columns, which we don’t want. Let’s click on our trend­line, then press Ctrl + 1. In the For­mat Tred­line win­dow, we can see that we can mod­i­fy it in many ways. Let’s click on the buck­et icon, and change its col­or (Fig. 2

 Color modification
Fig. 2 Col­or modification

Now, I can see my trend­line on the columns. When we select our trend­line once more and press Ctrl + 1 again, we can even add an equa­tion and some sta­tis­ti­cal infor­ma­tion (Fig. 3)

Statistical information
Fig. 3 Sta­tis­ti­cal information

If we don’t want it, we can press Delete. It’s impor­tant that the trend­line does­n’t work with all chart types, only the most com­mon ones, like a col­umn chart or a line chart (Fig. 4)

A line chart with a trendline
Fig. 4 A line chart with a trendline

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