Merge Cells vs Center across selection

How can we cre­ate a head­line title that is in the Cen­ter Across Selec­tion mode?

Merge Cells vs Cen­ter across selection

In Excel, we have two solu­tions. We can select sales and use the Megre&Center com­mand from the Home tab (Fig. 1) 

Megre&Cente command
Fig. 1 Megre&Center command

Excel will merge cells into one cell and align it in the cen­ter (Fig. 2).

One, centered cell
Fig. 2 One, cen­tered cell

This solu­tion, how­ev­er, has got a small draw­back as it cre­at­ed one cell instead of many cells. When we try to select only one col­umn and go a bit too high, we end up in select­ing every col­umn (Fig. 3)

All columns are selected
Fig. 3 All columns are selected

But, when we go down again, we will select only one col­umn again, so it’s not a big prob­lem. Some­times, we want to move our data a bit to the right or left. When we try to copy our range, we can’t select only cell B1, which is a bit prob­lem­at­ic. After select­ing the whole range, we want to move it to the right. How­ev­er, there’s still a prob­lem. If we want to move the range only a bit to the left or right, we can­not do it (Fig. 4).

Merged cells cannot be moved only a bit
Fig. 4 Merged cells can­not be moved only a bit

We have to go far enough to the right to make Excel copy the merged cell (Fig. 5).

 Merged cells moved
Fig. 5 Merged cells moved

I want to show you one more solu­tion. Let’s des­e­lect the Megre&Center com­mand. Now that we have our range select­ed, we can press the Ctrl + 1 short­cut to go to the For­mat Cells win­dow. In the win­dow, we have to go to the Align­ment tab, then select the Cen­ter Across Selec­tion com­mand in the Hor­i­zon­tal area, and press OK (Fig. 6). 

Format Cells window
Fig. 6 For­mat Cells window

We can see that our select­ed cells have merged. But this time, when we try to select one whole col­umn, we can do it (Fig. 7).

Whole column selected
Fig. 7 Whole col­umn selected

You have to remem­ber that now the val­ue is locat­ed in cell A1. There’s noth­ing in B1, C1 and D1 cells. The val­ue was just cen­tered across selec­tion. Let’s now change the col­or­ing of the head­line title and try to move it a bit to the right (Fig. 8).

Moving the range
Fig. 8 Mov­ing the range

As we can see, it’s pos­si­ble (Fig. 9).

The whole range moved a bit
Fig. 9 The whole range moved a bit

When we have the cell in the Cen­ter Across Selec­tion mode, it’s also impor­tant that when we want to add some text to one of the cells, the Cen­ter Across Selec­tion option will work only on the cells that are not filled (Fig. 10)

Center Across Selection working only in cells A1, B1 and C1
Fig. 10 Cen­ter Across Selec­tion work­ing only in cells A1, B1 and C1

https://www.youtube.com/watch?v=9P4HxHSbpbA

How to extract a date number and income from text string with a fixed width

Some­times, our data is com­bined into one string and we want to extract only a piece of infor­ma­tion, which will help us prop­er­ly under­stand our data. 

How to extract a date num­ber and income from text string with a fixed width

Let’s start with extract­ing the date. What is impor­tant in our exam­ple, is that each string of infor­ma­tion is of the same length, i.e. it has got a fixed width. 

Fig. 1 Data of the same string lengths

We can clear­ly see, that the date starts with the eighth sign and has got eight signs itself (mm/dd/yy). If we want to extract a cer­tain piece of infor­ma­tion, we have to use the MID func­tion. First, we have to write A2 in the argu­ment, because our infor­ma­tion is locat­ed in this cell. Then, we write 8 because we start with the eighth sign, and then 8 again because we want to extract eight chars. And we have our for­mu­la (Fig. 2).

=MID(A2,8,8)

Fig. 2 For­mu­la for extract­ing a date

After copy­ing it down, we have the results. It’s impor­tant though, that the MID func­tion, just like all text func­tions, returns results as text. We can see it because each date is aligned to the left. It may be prob­lem­at­ic if we want to do some date oper­a­tions. We can change the text by adding 0 to our for­mu­la. In oth­er words, we can per­form any math­e­mat­i­cal oper­a­tion that won’t change the returned date (Fig. 3). 

=MID(A2,8,8)+0

Fig. 3 Adding 0 to dates

Now, we can see that the val­ues are aligned to the right. It means that Excel treats them like num­bers, i.e. like dates. We can extract Id num­bers the same way. They start with the first sign and have got 6 dig­its in total. We can also use the MID func­tion. First, we select cell A2, then write 1 because it starts from the first sign, then we write 6 because we extract 6 dig­its (Fig. 4).

=MID(A2,1,6)

Fig. 4 MID func­tion for­mu­la for extract­ing Id numbers

As we can see, Excel extract­ed Id num­bers. Since it is text, Excel left the lead­ing zero for us. We can leave Id num­bers as text if it’s impor­tant for us. If it isn’t, we can do the same as with dates, i.e. add zero (Fig. 5). 

=MID(A2,1,6)+0

Fig. 5 Adding 0 to Id numbers

We can see that Id num­bers moved to the right and the lead­ing zero van­ished. The last piece of infor­ma­tion we want to extract is the Income. Income val­ues don’t have a fixed width. But, since it’s the last piece of infor­ma­tion, we can extract more signs than we need. Let’s extract also the dol­lar sign. The dol­lar sign is in the sev­en­teenth posi­tion. We start writ­ing the MID for­mu­la, then we add cell A2, then 17, and then we have to add the num­ber of places we want too extract. Let’s write 10. It’s, in fact, more that we need, how­ev­er it’s not less either. The MID func­tion will extract the infor­ma­tion to the end with­out any errors (Fig. 6). 

=MID(A2,17,10)

Fig. 6 MID func­tion for extract­ing Income

As in our pre­vi­ous for­mu­las, the results are also text. By adding zero, we change the results into numbers.

MID(A2,17,10)+0

Fig. 7 Text into numbers

We can see that now the results are num­bers. How­ev­er, we can see that we lost the dol­lar sign. This is the way Excel con­verts num­bers with dol­lar signs before them. Indeed, the dol­lar sign isn’t impor­tant in our data, so we should start from the eigh­teenth sign (Fig. 8).

Fig. 8 Remov­ing the dol­lar sign

Now, we have only num­bers. If we want to add a cur­ren­cy, we just go to the Home tab, drop down the Gen­er­al bar and select the Cur­ren­cy option (Fig. 9). 

Fig. 9 Adding a currency

When we have our results with zeros at the end, we can remove them by press­ing the Decrease Dec­i­mal option (Fig. 10).

Fig. 10 Remov­ing zeros at the end

https://www.youtube.com/watch?v=O39qM233-68