The magical role of wildcards in Excel

  
The wildcards “?”“*”“~” can represent any or a range of characters. In Excel, the use of wildcards can not only perform fuzzy query substitution, but also perform fuzzy calculations by cooperating with functions. Use wildcards to replace the instance description: In the work registration form, there is a phenomenon in which the word of the author has a homonym of different words, and the requirements are changed to the correct name (Figure 1). Let's analyze that the second word in the table "Ma Zhen'an" appears in the second word "shock", "vibration", "rural", "three towns", to be changed to the correct " Ma Zhenan & rdquo;, if one by one, the number is small, it does not bother, but the number of changes has been much, it is still very troublesome. At this point, we can use wildcards to query and replace the author. Use the key combination Ctrl+F to bring up the “Find and Replace” dialog box, select the “Replace” label, and “Find the content” in the “Enter the content” and “Enter the Horse” (Note that it is the English half-width) ? & rdquo;), in the "replaced with" & rdquo; enter the correct "Ma Zhenan", and finally click on the "Replace all" button, then the author in the table is "Ma Zhenan", "Ma" Zhenan & rdquo;, "Ma Zhenan", are replaced by "Ma Zhenan" (Figure 2). Tip: There are 3 wildcards in Excel, which are ? (question mark), * (asterisk), ~ ​​(tilde). Where ? (question mark) can represent any single character; * (asterisk) can represent any number of characters; ~ (tilde) can be followed by ?, * or ~ question mark, asterisk or tilde, for example, "fy06 ~?” can be found “fy06?” Visible, with the help of wildcards, a wider range of query replacement in Excel, is still very useful in daily office. Description of the application of wildcards in the calculation: A shopping mall should count the sales of electric vehicles of various brands in a week. The electric vehicles in this mall mainly include the four brands of Giant, 彪, 追, 雅迪, etc., and they are required to classify and collect the four major brands for one week. Let's analyze if we sort and summarize the data according to the usual practice, and then fill the results into the corresponding cells, but when we sort by product, these brands have two models, this brand The two models are divided into two categories, which is obviously not acceptable. Is there any way to count the sales of these brands at once? At this point, we can use the SUMIF function to count the data. Because wildcards are allowed in the SUMIF function, the classification problem can be solved very well. We can enter “=SUMIF($B$2:$B$25,E4&"*",$C$2:$C$25)” in the F4 cell, then drag the fill handle to fill the formula to F7 The cell is ready (Figure 3). The SUMIF function is used to sum the specified cells by a given condition. Its syntax is SUMIF(range,criteria,sum_range). Range is the range of cells to be looked up by criteria. That is, $B$2:$B$25Criteria in the formula is a condition for determining which cells are added, and can be in the form of numbers, expressions, or text. For example, a condition can be expressed as 32, "32", ">32" or "apples". E4&"*" in the formula, which uses the & symbol, which means that the connection is connected, that is, the value of the E4 cell is connected with the wildcard “*” to get "Giant*”. Sum_range is the actual cell to be added (if the relevant cells in the range meet the criteria). If sum_range is omitted, when the cells in the region meet the condition, they are calculated both by condition and by addition. The entire formula indicates that the B2:B25 lookup brand is a product of “Jianant”, and finds their total sales after finding it. This article comes from [System Home] www.xp85.com
Copyright © Windows knowledge All Rights Reserved