Excel中的函数公式种类繁多,尽管完全掌握所有函数是不现实的,但掌握常用函数公式尤为关键。

一、Randbetween

功能:在指定范围内生成随机整数。

语法:=Randbetween(最小值,最大值)

示例:生成200-500之间的随机数

方法:

在目标单元格中输入公式:=RANDBETWEEN(200,500)。

说明:

生成的随机数包含“最大值”和“最小值”。按F9键可刷新随机数。

二、Large

功能:获取数据中第K个最大值。

语法:=Large(数据范围,K),其中K为相对位置

示例:返回“销售额”中排名前3的销售额

方法:

在目标单元格中输入公式:=LARGE(F$3:F$9,J3)。

说明:

J3代表K值。由于要返回3个值,因此数据范围需混合或绝对引用。

三、Small

功能:获取数据中第K个最小值。

语法:=Small(数据范围,K),其中K为相对位置

示例:返回“销售额”中排名后3的销售额

方法:

在目标单元格中输入公式:=SMALL(F$3:F$9,J3)。

说明:

在Small函数中,“1”代表倒数第一,与Large函数中的“1”含义相反。

四、Phonetic

功能:将指定范围内的字符串连接成一串(数字除外)

语法:=Phonetic(数値范围)

示例:将“市”和“区”合并

方法:

在目标单元格中输入公式:=PHONETIC(G3:H3)。

说明:

Phonetic函数只接受一个参数,即数据范围。要合并非连续的值,可使用“&”符号或Textjoin函数。

五、Text

功能:根据指定的格式代码返回对应值

语法:=Text(值,格式代码)

示例:以“年月日”格式返回今日日期

方法:

在目标单元格中输入公式:=TEXT(TODAY(),”yyyy年mm月dd日”)。

说明:

The Today function returns today’s date, but the default format is not in “year-month-day” format, and “yyyy-mm-dd” is the standard date format.

Six, Round.

Function: Rounds a number to a specified number of digits.

Syntax: =Round(value, number of decimal places).

Purpose: Rounds the “Sales” to the nearest 100.

Method:

Enter the formula in the target cell: =ROUND(F3,-2).

Interpretation: When the Round function’s number of decimal places is negative, it fills the absolute value of the number of decimal places with 0s from right to left, without rounding.

Seven, Int.

Function: Rounds down to the nearest integer.

Syntax: =Int(value or cell reference).

Purpose: Rounds down the “Sales” to the nearest integer.

Method:

Enter the formula in the target cell: =INT(F3).

Interpretation:

The Int function effectively removes the decimal point and any values that follow it.”

Eight, RoundUp.

Function: Rounds a number up.

Syntax: =Roundup(value, number of decimal places).

Purpose: Rounds up the “Sales” to the nearest integer.

Method:

Enter the formula in the target cell: =ROUNDUP(F3,0).

Interpretation:

If the number of decimal places is set to “0,” the number is rounded to the nearest integer, with the rounding rule being +1 if there is a decimal and not following the rounding rules.

Nine, Formulatext.

Function: Returns a formula as a string.

Syntax: =Formulatext(cell address).

Purpose: Quickly review the calculation formula.

Method:

Enter the formula in the target cell: =FORMULATEXT(F3).

Interpretation:

You can also use the [Formula] – [Show Formula] method to view the formula.

Ten, Char.

Function: Returns the character specified by the number.

Syntax: =Char(number).

Purpose: Generates an alphabetical sequence starting with A.

Method:

Enter in the target cell: =CHAR(ROW(A1)+64).

Interpretation:

If you fill the serial number in the same column, the formula is: =CHAR(COLUMN(A1)+64). The principle is the same in both cases, using the Row or Column function to get the dynamic row number or column label.

Eleven, Time.

Function: Returns the serial number for a specific time.

Syntax: =Time(hour, minute, second).

Purpose: Returns the exact time 5 hours later.

方法:

在目标单元格中输入公式:=NOW()+TIME(5,0,0)。

解读:

now函数会返回当前时间。

十二、Edate。

功能:获得指定月份之前或之后的日期。

语法结构:=Edate(开始日期,月份)。

目的:获得5个月以后的日期。

方法:

在目标单元格中输入公式:=EDATE(TODAY(),5)。

解读:

Today函数会返回当前日期,当前日期会随着自然日期变化而变化,如果想获得固定的日期,需要将当前日期替换为具体的日期。

十三、Sumproduct。

功能:计算各个数组或区域乘积的和。

语法结构:=Sumproduct(数组或区域1……[数组或区域N])。

目的:得到总销售额。

方法:

在目标单元格中输入公式:=SUMPRODUCT(D3:D9,E3:E9)。

解读:

上述公式的计算过程为:D3E3+D4E4+D5E4+D6E6+D7E7+D8E8+D9E9。

十四、Proper。

语法结构:=Proper(字符串)。

功能:将字符串中的英文首字母大写。

目的:将字符串中的首字母大写。

方法:

在目标单元格中输入公式:=PROPER(B3)。

解读:

如果字符串的首字母已经是大写,则结果不会发生变化。

十五、Rank。

功能:获取指定值在指定序列中的排位,若有多个值排名相则返回平均排名。

语法结构:=Rank(值,数值范围,[排序方式]),其中【排序方式】可选0或1,0或省略时为降序,1为升序。

目的:按“销售额”降序进行排序。

方法:

在目标单元格中输入公式:=RANK(F3,F$3:F$9,0)。

解读:

也可以使用公式=RANK(F3,F$3:F$9)来实现,当省略第三个参数时,默认为降序排序。