Using excel to connect strings is a commonly used technique in our daily work. I believe that the most commonly used connection method is "&". But in fact, there are many ways to connect strings in excel, and the seemingly inconspicuous connection string has magical effects in some specific occasions. Are you curious? Hurry up and follow the author's instructions in Picture E and take a look!
[Foreword]
In the actual application of using EXCEL, we often use it for statistical convenience , if the data elements are divided into more details, the statistics will have more dimensions. Similarly, sometimes we also need to split very detailed content and merge it into one content and put it in a cell, maybe for reference, maybe for identification or reading. Let’s take a common small example - such as "Daily Data Report".
For the convenience of statistics, we will definitely make the content in 1:2 lines; but if the leader needs us to make a report, it is recommended to make it in 5:8 lines. This makes it more readable.
[Text]
In order to use EXCEL to deal with such problems more conveniently, EXCEL has prepared many methods for us——&, CONCATENATE and PHONETIC functions are used to handle it, and there will also be some "external force" methods to solve it. Today we will use the same simulation data to introduce it to everyone separately, hoping that students will not be in a hurry when encountering similar problems.
[Data source]
Data source processing requirements: connect the values of each field to form The new string is filled in column H.
Our simulation data adopts the format of "pure numbers". In order to facilitate the versatility of string connection, we also use the "one-digit" method, so that everyone can understand a certain number in it. It can also be a string that needs to be connected. Before looking at the following content, first think about how we will solve it. Learning with thinking will be of great benefit to students in absorbing knowledge and applying functions flexibly.
【Solution】
Method 1
I2 cell function:
=A2&B2&C2&D2&E2&F2&G2
This should be the most commonly used method of connecting strings by students. There is not much to introduce.
Method 2
I2 cell function:
=CONCATENATE(A2,B2, C2,D2,E2,F2,G2)
The CONCATENATE function can connect up to 255 parameters, and the total number of characters must not exceed 8192. In the EXCEL365 version, there are several new functions, among which the CONCAT function is an upgraded version of the CONCATENATE function. However, because higher versions of EXCEL are not yet so popular, we will not talk about these things that cannot be tested by everyone.
In addition, many people say that the EXCEL2016 version has these new functions TEXTJOIN, CONCAT, IFS, DATESTRING, NUMBERSTRING, IFS, MINIFS, and MAXIFS, but according to the author’s E diagram, not all of them The EXCEL2016 version has these functions. It is said that these functions were included in the EXCEL2016 version during testing, but after the EXCEL365 version was released, they were canceled in EXCEL2016. I don’t know, but if you have the conditions, it is still recommended to use a higher version of EXCEL so that you can try many new functions.
Method 3
I2 cell function:
{=SUM(A2:G2 *10^(COUNTA(A2:G2)-COLUMN(A:G)))}
This is an array function. You need to press "CTRL SHIFT ENTER" three times after entering the function. The key ends function entry and only applies to data sources with a single digit in the cell.
Function analysis:
This function uses mathematical thinking, taking the first row of data as an example, the idea is as follows:
Then let’s see what the rules are for the corresponding “0” on each bit, and whether our function perfectly meets my requirements:
From the above table, we can see that the COUNTA(A2:G2)-COLUMN(A:G) function can help us calculate how many 0s there will be in each digit. Using 10^ (^ is The meaning of exponentiation is equivalent to the usage of the POWER function) to determine which digit the number in each field is. For example, 10^6, which is 10 raised to the 6th power, is equal to 1000000. The overall function is listed in the following table:
Field name |
corresponding value |
multiplied by the corresponding number of digits |
##corresponding product |
Field 1 | 7 | ##10000007000000 | |
8 |
##100000 |
800000 |
Field 3 |
6 |
10000 |
##60000 | ##Field 4 |
1000 | 4000 | #Field 5 | |
100 | 000 |
||
Field 6 |
4 |
10 |
40 |
##Field 7 | 4 | 1 | 4 |
The above is the detailed content of Practical Excel skills sharing: the magical use of connection strings!. For more information, please follow other related articles on the PHP Chinese website!