COUNTA Function counting almost everything

Today, we are going to talk about the COUNTA func­tion. This func­tion counts almost every­thing, It counts for­mu­la results (Fig. 1),

COUNTA Func­tion count­ing almost everything
Formula results
Fig. 1 For­mu­la results

num­bers writ­ten as text (Fig. 2), 

Numbers written as text
Fig. 2 Num­bers writ­ten as text

dates and time (Fig. 3),

Dates and time
Fig. 3 Dates and time

log­i­cal val­ues (Fig. 4),

Logical values
Fig. 4 Log­i­cal values

num­bers (Fig. 5),

Numbers
Fig. 5 Numbers

and errors (Fig. 6). 

Errors
Fig. 6 Errors

It even counts a sin­gle num­ber or val­ue that we put as an argu­ment to COUNTA func­tion (Fig. 7) 

A number put as an argument
Fig. 7 A num­ber put as an argument

Let’s write an array with four ele­ments. It does­n’t mat­ter how many columns of rows this array has, but it’s impor­tant how many ele­ments there are. So, we have a range of two cells with num­bers, a sin­gle val­ue and four ele­ments (Fig. 8). 

A range, a single value and four elements
Fig. 8 A range, a sin­gle val­ue and four elements

Since COUNTA func­tion counts every ele­ment, it returns 7 (Fig. 9)

The function returned 7
Fig. 9 The func­tion returned 7

How­ev­er, there is one thing that the COUNTA func­tion does­n’t count. It does­n’t cells that are real­ly emp­ty. Cell A14 is real­ly emp­ty, how­ev­er cell B14 isn’t. It has got a for­mu­la that returns an emp­ty text string. COUNTA func­tion counts an emp­ty text string (Fig. 10).

Empty text string
Fig. 10 Emp­ty text string

Even if a for­mu­la returns a val­ue from an emp­ty cell (B15), the COUNTA func­tion will count cell A15 because it has got a for­mu­la (Fig. 11)

 A cell with a formula
Fig. 11 A cell with a formula

The for­mu­la in cell B14 was count­ed by the COUNTA func­tion (Fig. 12)

A cell with a formula
Fig. 12 A cell with a formula

How­ev­er, if we delete the for­mu­la, the COUNTA func­tion will return 0 because cells A14 and B14 are now real­ly emp­ty (Fig. 13)

Empty cells
Fig. 13 Emp­ty cells

Sum­ming up, the COUNTA func­tions counts every­thing except for emp­ty cells. 

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

Paste as values, the Paste Special window

Some­times, when we have for­mu­la results, we want to have only the text, i.e. the answer (Fig. 1). 

Paste as val­ues, the Paste Spe­cial window
TRIM function results
Fig. 1 — TRIM func­tion results

We can copy the results, then right click a tar­get cell and choose the Paste Val­ues option from the pop-up menu (Fig. 2). 

Fig. 2 — Pop-up menu — Paste values

And, we have just text not for­mu­la (Fig. 3).

Pasted values (text)
Fig. 3 — Past­ed val­ues (text)

There is one more solu­tion. When we copy our for­mu­la, we click on a tar­get cell and press Alt + Ctrl + V com­bi­na­tion to show the Paste Spe­cial win­dow (Fig. 4). In the Paste area, we click Val­ues, in the Oper­a­tion area, we choose None, then we press OK. 

Paste Special window
Fig. 4 — Paste Spe­cial window

Now, we have the results only once. We don’t need the extra col­umn, so we must delete it (Fig. 5) 

Deleting column
Fig. 5 — Delet­ing column

https://www.youtube.com/shorts/3UD7n8Jtu3I

Relative and absolute cell references

Today, we will dis­cuss rel­a­tive and absolute ref­er­ences. Let’s start with rel­a­tive ref­er­ences to count a prof­it. If you want to count the prof­it, you just deduct expens­es from income (Fig. 1).

Rel­a­tive and absolute cell references

Source data
Fig. 1 — Source data

It means that you sub­tract the cell C3 val­ue from the val­ue in cell B3 (Fig. 2):
=B3 — C3

 Income minus expenses
Fig. 2 — Income minus expenses

When we copy this for­mu­la down, it’s chang­ing because we have dif­fer­ent results in dif­fer­ent cells. When we look at our for­mu­la, it refers to cells B3 and C3. But, in real­i­ty, it refers the cells which are one place to the left and two places to the left (Fig. 1). In the last for­mu­la (=B14-C14), we can see B14 minus C14 (Fig. 3) but it’s still one cell to the left and two cells to the left. The rel­a­tive ref­er­ence is mov­ing with the for­mu­la and cell.

Formula change after copying down
Fig. 3 — For­mu­la change after copy­ing down

We don’t always want the for­mu­la to behave this way. In our sec­ond exam­ple you can see an absolute ref­er­ence. We want to count the tax for each prod­uct. That’s why we have to mul­ti­ply the price by our tax. How­ev­er, we don’t want the tax cell to move, so we must lock cell J2 by press­ing F4 key — add two $ signs (Fig. 4):

=G2*$J$2

Tax calculations
Fig. 4 Tax calculations

When we copied our for­mu­la down, only cell G2 had changed because it’s a rel­a­tive ref­er­ences. Cell J2 stayed the same and it will not move from this cell (Fig. 5)

Absolute reference after dragging down
Fig. 5 Absolute ref­er­ence after drag­ging down

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

Data bars in a cell using character repeat

Today, we are going to talk about cre­at­ing charts like data bars in cells using for­mu­las. We want to cre­ate some­thing like this (Fig. 1)

Data bars in a cell using char­ac­ter repeat
Charts from data bars
Fig. 1 Charts from data bars

Let’s start with cre­at­ing a prop­er for­mu­la. We have to use the REPT (repeat) func­tion. It will repeat a text, one or more chars, as many times as we write in the sec­ond argu­ment. Let’s start with a pipe (a ver­ti­cal line). We want to repeat it as many times as there are sun­ny days in a giv­en month. Our for­mu­la looks like this (Fig. 2). 

=REPT(“|”,B2)

REPT formula with a pipe
Fig. 2 REPT for­mu­la with a pipe

After enter­ing and copy­ing down, we have data bars. How­ev­er, the dis­tance between indi­vid­ual signs is too big (Fig. 3) 

Data bars with too long distances
Fig. 3 Data bars with too long distances

We have to nar­row it by using, e.g. a dif­fer­ent font that works with this sign. We are select­ing our data bars and chang­ing the font name to Script (Fig. 4). Now, it looks much better. 

Font change
Fig. 4 Font change

Let’s try, how­ev­er, a dif­fer­ent font. With Bri­tan­ni­ca Bolt, the signs look like real data bars (Fig. 5). 

Font change again
Fig. 5 Font change again

Let’s take the last exam­ple, which is the Haet­ten­schweil­er font. In my opin­ion, it looks the best, so I’m stay­ing with this one (Fig. 6)

The best font
Fig. 6 The best font

Apart from repeat­ing a pipe, we can repeat oth­er signs. If they are wider than the pipe and if the num­ber of repeats is too big, we may have a prob­lem (Fig. 7)

=REPT(“*”,B2)

A formula with an asterisk
Fig. 7 A for­mu­la with an asterisk

We can see, that the aster­isk string is too long (Fig. 8)

Too long
Fig. 8 Too long

The solu­tion is divid­ing the num­ber, and the REPT func­tion will only look at the inte­ger part of the num­ber. Let’s divide our num­bers safe­ly by two (Fig. 9). 

=REPT(“*”,B2/2)

Number division
Fig. 9 Num­ber division

When there is a small­er num­ber of repeats, it looks quite good (Fig. 10) 

Shorter strings
Fig. 10 Short­er strings

We have to remem­ber that an aster­isk is a sim­ple sign, and we can use what­ev­er sign we like. Let’s take, for exam­ple, a star (Fig. 11) 

=REPT(“★”,B2/2)

A formula with a star
Fig. 11 A for­mu­la with a star

We can see that the strings are very long (Fig. 12). We can divide them by even a greater num­ber, e.g. 3. 

=REPT(“★”,B2/3)

Dividing by 3
Fig. 12 Divid­ing by 3

After putting the for­mu­la, it looks good (Fig. 13). 

Shorter strings
Fig. 13 Short­er strings

In our last exam­ple, we are going to repeat the let­ter n (Fig. 14)

=REPT(“n”,B2/3)

Repeating n
Fig. 14 Repeat­ing n

Now, we can see many ns (Fig. 15) 

N string
Fig. 15 N string

How­ev­er, we can change our font into Wind­ings, and the let­ter n changes into squares, which looks quite good as data bars (Fig. 16)

N into squares
Fig. 16 N into squares

Sum­ming, up, when we use dif­fer­ent signs and dif­fer­ent num­ber of repeats, we can cre­ate quite good data bars using a formula. 

https://www.youtube.com/watch?v=XYs6Eu-0hZw

Filtering multiple Pivot Tables at once using a slicer

Today, we are going to talk about how to fil­ter many piv­ot tables at once. We have three piv­ot tables based on the same dataset from the left (Fig. 1).

Fil­ter­ing mul­ti­ple Piv­ot Tables at once using a slicer
Three Pivot tables
Fig. 1 Three Piv­ot tables

If we want to fil­ter many piv­ot tables at once, we have to con­nect then into one slice. We have to select one cell from the first piv­ot table, then find the Pivot­Table Ana­lyze tab and Insert Slicer com­mand, where we want to add the slicer by Coun­try (Fig. 2)

Slicer by country
Fig. 2 Slicer by country

After press­ing OK, we have the slicer. We can change its size and col­or (Fig. 3).

Color and size change
Fig. 3 Col­or and size change

Now, we can fil­ter the first piv­ot table with the slicer. When we click on the name of a coun­try, we can see changes in the first piv­ot table (Fig. 4). How­ev­er, the sec­ond and the third piv­ot table did not change because they are not con­nect­ed to the slicer. 

Slicer for the first pivot table
Fig. 4 Slicer for the first piv­ot table

In order to con­nect then, we select the slicer, then we click on the Slicer tab, then the Report Con­nec­tion com­mand, which opens up a win­dow, where we can see three piv­ot tables. They have gener­ic, default names, and when we aren’t sure if they are the right ones, we can look which sheet they are locat­ed in. Then, we check prop­er check box­es to con­nect all piv­ot tables and press OK (Fig. 5)

Connecting three pivot tables
Fig. 5 Con­nect­ing three piv­ot tables

Now, we can see that the slicer is fil­ter­ing all, three, con­nect­ed piv­ot tables (Fig. 6)

Slicer for three pivot tables
Fig. 6 Slicer for three piv­ot tables

When the piv­ot table name or the sheet name is not enough to iden­ti­fy the right one, we can change their names. When you select a prop­er piv­ot table, go to the Piv­ot­Table Ana­lyze tab, then select the Piv­ot­Table Name com­mand, and write the name you want. Let’s write Piv­ot­Date (Fig. 7). Giv­ing names to piv­ot table makes it eas­i­er to work with them. 

Name change
Fig. 7 Name change

Now, that we have the slicer, we can eas­i­ly fil­ter three piv­ot tables at once (Fig. 8).

Ready slicer for three pivot tables
Fig. 8 Ready slicer for three piv­ot tables

https://www.youtube.com/watch?v=6TDXBG-wdhM