0. Excel formula functions Introduction
Many functions can be built Excel formulas to complete numerical function, logic determining function, find a match function, the function formulas used in routine data processing and analysis reports to improve the working efficiency.
1. Logic Function
- IF
features: Analyzing conditions, to perform operations to perform operations a two o'clock, the condition is not satisfied when the condition is satisfied. if the following function may be combined and, or, not determination conditionsIF(logical_test,[value_if_true],[value_if_false])
- AND
Function: a logical AND operation, returns True when all conditions are true is determined, otherwise returns FalseAND(logical1,[logical2]...)
- OR
function: a logical OR operation, when the judgment condition returns True, there is established a certain, otherwise returns FalseOR(logical1,[logical2]...)
- NOT
function: logical NOT operator, i.e., inverted BooleanNOT(logical)
2. Find function
- match
Function: Returns the value of the relative position of a particular order to meet specific item in the arrayMATCH(lookup_value,lookup_array,[match_type])
Find a location where Shanghai
MATCH("上海",C2:C14) # 结果返回3
- index
function: in a given range of cells, the cell returns the value of the index value according to the ranksindex(array,row_num,[col_num]
Find the table row 2 2
=INDEX(A2:C14,2,2) # 返回菲亚特
- lookup
Function: a value from a lookup array or vectorlookup(lookup_value,array) lookup(lookup_value,lookup_vector)
Find Sales Lee Ling sells brand
LOOKUP("李乐菱",A2:B14) # 返回宝马
-
vlookup
Function: the first column received search table area elements satisfy a condition determined row number of cells to be searched, and then returns the corresponding valuevlookup(lookup_value,table_array,row_index_num,[range_lookup])
Winnings are calculated based on sales
VLOOKUP(A2,$D$7:$E$18,2)*A2 # 返回219.3
Winnings are calculated results are as follows
- hlookup
Function: the first column received search table area element satisfying the condition, determines the column number of cells to be searched, and then returns the corresponding valuehlookup(lookup_value,table_array,row_index_num,[range_lookup])
Winnings are calculated results are as follows
3. Statistical Functions
- sum
Function: summing
* sumif
Function: Conditional Sum
calculate the sales greater than the sum of sales 5000SUMIF(A2:A6,">5000") # 返回8052
- sumifs
功能:多条件求和
计算销售额在3000-5000之间的销售额总和SUMIFS(A2:A6,A2:A6,">3000",A2:A6,"<5000") # 返回12272
- average
功能:求平均值 - max
功能:计算最大值 - min
功能:计算最小值 - count
功能:计数 - countif
功能:条件计数
计数上面销售额大于5000COUNTIF(A2:A6,">5000") # 返回1
- countifs
功能:多条件计数
计数销售额在3000-5000之间COUNTIFS(A2:A6,">3000",A2:A6,"<5000") # 返回3
- rank
功能:返回某一数值相对于其他数字的排名rank(number,ref,[order])
4. 引用函数
- indirect
功能:返回文本字符串指定的引用INDIRECT(ref_text,[a1])
制作全国地区和省份两级下拉菜单
(1)地区字段设置数据认证
(2)省份字段数据认证
最后效果如下
5. 数学函数
- round
功能:按照指定的位数进行四舍五入round(number,num_digits)
例如将圆周率取2位有效数值
ROUND(3.141592653,2) # 返回3.14
- roundup
功能:向上舍入数字roundup(number)
- rounddown
功能:向下舍入数字rounddown(number)
- int
功能:向下取整int(number)
- trunc
功能:将数字截为整数或指定位数小数trunc(number,[num_digits])
6. 文本函数
- find
功能:查找字符在单元格中的位置,返回位置索引find(find_text,within_text,[start_num]) start_num:开始查找文本的编号
对于地址"江苏省南京市宣武区新街口街道"需要提取省份信息,可以使用如下公式实现
=LEFT("江苏省南京市玄武区新街口街道",FIND("省","江苏省南京市玄武区新街口街道"))
- left
Function: extracting a plurality of lengthwise text from left cellleft(text,[num_chars]) num_chars:提取字符个数,默认提取一个字符
Department above for the extraction of information can be directly used
LEFT("江苏省南京市玄武区新街口街道",3)
Above to find the location using the find "province" appears, and then left the provinces to find information. Such operations have general, not more than some provinces are generally more words, such as Heilongjiang, you need to extract the number of characters is 4
- right
functions: extracting a plurality of lengthwise text from the right side of the cellright(text,[num_chars]) num_chars:提取字符个数,默认提取一个字符
Also at the above address information, for example, the need to extract street information, you can use the formula
RIGHT("江苏省南京市玄武区新街口街道",LEN("江苏省南京市玄武区新街口街道")-FIND("区","江苏省南京市玄武区新街口街道"))
- trim
function: for the spaces before the cell content is removed, but without removing the space between characterstrim(text)
- concatenate
function: string concatenationconcatenate(text1,text2...)
- upper
Function: lowercase letters converted to uppercase lettersupper(text)
- lower
function: uppercase letters converted to lowercase letterslower(text)
- replace
features: a partial string in the string is replaced with another stringreplace(old_text,start_num,num_chars,new_text)
For example, "Xinjiekou Street, Xuanwu District, Nanjing, Jiangsu Province" in "Xinjiekou Street" with "Xuanwu Lake Street"
=REPLACE("江苏省南京市玄武区新街口街道",FIND("区","江苏省南京市玄武区新街口街道")+1,LEN("江苏省南京市玄武区新街口街道")-FIND("区","江苏省南京市玄武区新街口街道"),"玄武门街道")
- substitute
Function: a character string in the character string is replaced with a new string portionsubstitute(text,old_text,new_text,[instance_num] instance_num:指明替换数目,默认全部替换
For example, the "China - Beijing - Beijing area" with "China - Shanghai - Shanghai area", the formula is
SUBSTITUTE("中国-北京-北京市区","北京","上海")
- clean
function: delete text in all non-printable charactersclean(text)