主页 > 办公教程 >

OneNote表格里的公式计算实例教程

办公教程 2023-09-22

OneNote 表格公式是 Gem for OneNote 的一组功能。这组功能为 OneNote 的表格添加类似 Excel 的公式,用于计算统计单元格。

如何找到 OneNote 表格公式
OneNote 表格公式隐藏在第二个“珍”选项卡中。当你在 OneNote里选中表格时,该选项卡才会出来。
首先,在 OneNote 当前页面里,创建或者选中一个表格。这是 OneNote 功能区会多出一个“表格工具”的隐藏选项卡集合,这个选项卡集合显示有 2 个选项卡“布局”和“珍”选项卡。
其中“珍”选项卡则是 Gem for OneNote 的选项卡,专门用于针对表格的处理功能。表格公式就在这个组里。
如何找到 OneNote 表格公式
在单元格里插入公式
首先,你可以选中一个或者选中一组单元格。然后在点击“表格公式”功能。则会弹出一个“Formula”的对话框。
在 Formula  公式对话框里:
  •     在 Formula:输入框,输入你的公式
  •     在 Format:输入框里,输入格式。用于对公式计算的结果,按一定的格式显示到单元格里。
  •     Function 列表里,则是列出 Gem 表格公式支持的函数。
点击“OK”按钮,则会把公式放到这个单元格里,并显示格式化的计算结果。
如果选中的是多个单元格,则 Gem 会应用这个公式到所有选中的单元格,同时会自动调整公式里的单元格地址,以相对性的进行计算。
比如:对 单元格 D3 到 D14 进行批量应用公式 D2+B3-C3
则应用公式后的结果是:
  •     单元格 D3 得到的公式是 D2+B3-C3
  •     单元格 D4 得到的公式是 D3+B4-C4
  •     单元格 D5 得到的公式是 D4+B5-C5
  •     ……
在单元格里插入公式
​修改单元格里的公式
如果想修改单元格里已经存在的公式,则先选中这个单元格,或者选中这组单元格,再点击一次“表格公式”。还在弹出的 Formula 对话框里进行公式修改。
删除单元格公式
如果想删除单元格里的公式,可以先选中这个单元格(或者选中这组单元格),再点击功能区上的“公式”组里“删除”就可以把公式从这些单元格里移除掉了。
高亮存在公式的单元格
如果想知道哪里单元格包含公式,则可以点击功能区上的”公式”组里的“含公式格”,则会选中表格里所有包含公式的单元格。
重新计算单元格数值
在表格里修改完部分数值后,表格公式并不会自动计算数值,你需要到功能区里“公式”组,点击“重新计算”功能,来让表格里的公式重新计算。
单元格地址、单元格区域
单元格地址使用 A1 的格式指定一个单元格、一组单元格或一个单元格区域。
在此约定中,字母表示单元格所在的列,数字表示单元格所在的行。
表格中的第一列为列 A;第一行为行 1。
第一列第二行中的单元格
A2
第一行中的前两个单元格
A1,B1
第一列中的所有单元格以及第二列中的前两个单元格
A1:B2
第一行
1:1
第一列
A:A
单元格地址、单元格区域
​算数操作符
算数操作符包括:+,-,*(乘),/
例子 1:
单元格 D2 加上 单元格 B3 减去 单元格 C3
D2+B3-C3
其他例子:
  •     If( (D2+B3-C3)>(D3+B4-C4), (D2+B3-C3), (D3+B4-C4) )
  •     SUM(A:A) * SUM(B:B)
关系操作符
关系操作符包括: <, >, <=, >=, =
关系操作符的使用:
  •     If( D3>D4, D3, D4)
  •     AND(SUM(LEFT)<10,SUM(ABOVE)>=5)

显示格式

 

Date

以日期 2020-01-15 的格式显示值。
 

Time

以时间 09:12:13  的格式显示值。
 

DateTime

以日期时间 2020-01-15 09:12:13 的格式显示值。
 

Date: yyyy/mm/dd hh:nn:ss

以自定义的日期时间格式显示值。
Specifier Displays
c Displays the date using the format given by the ShortDateFormat global variable, followed by the time using the format given by the LongTimeFormat global variable. The time is not displayed if the date-time value indicates midnight precisely.
d Displays the day as a number without a leading zero (1-31).
dd Displays the day as a number with a leading zero (01-31).
ddd Displays the day as an abbreviation (Sun-Sat) using the strings given by the ShortDayNames global variable.
dddd Displays the day as a full name (Sunday-Saturday) using the strings given by the LongDayNames global variable.
ddddd Displays the date using the format given by the ShortDateFormat global variable.
dddddd Displays the date using the format given by the LongDateFormat global variable.
e (Windows only) Displays the year in the current period/era as a number without a leading zero (Japanese, Korean, and Taiwanese locales only).
ee (Windows only) Displays the year in the current period/era as a number with a leading zero (Japanese, Korean, and Taiwanese locales only).
g (Windows only) Displays the period/era as an abbreviation (Japanese and Taiwanese locales only).
gg (Windows only) Displays the period/era as a full name (Japanese and Taiwanese locales only).
m Displays the month as a number without a leading zero (1-12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mm Displays the month as a number with a leading zero (01-12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mmm Displays the month as an abbreviation (Jan-Dec) using the strings given by the ShortMonthNames global variable.
mmmm Displays the month as a full name (January-December) using the strings given by the LongMonthNames global variable.
yy Displays the year as a two-digit number (00-99).
yyyy Displays the year as a four-digit number (0000-9999).
h Displays the hour without a leading zero (0-23).
hh Displays the hour with a leading zero (00-23).
n Displays the minute without a leading zero (0-59).
nn Displays the minute with a leading zero (00-59).
s Displays the second without a leading zero (0-59).
ss Displays the second with a leading zero (00-59).
z Displays the millisecond without a leading zero (0-999).
zzz Displays the millisecond with a leading zero (000-999).
t Displays the time using the format given by the ShortTimeFormat global variable.
tt Displays the time using the format given by the LongTimeFormat global variable.
am/pm Uses the 12-hour clock for the preceding h or hh specifier, and displays 'am' for any hour before noon, and 'pm' for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
a/p Uses the 12-hour clock for the preceding h or hh specifier, and displays 'a' for any hour before noon, and 'p' for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
ampm Uses the 12-hour clock for the preceding h or hh specifier, and displays the contents of the TimeAMString global variable for any hour before noon, and the contents of the TimePMString global variable for any hour after noon.
/ Displays the date separator character given by the DateSeparator global variable.
: Displays the time separator character given by the TimeSeparator global variable.
 

 
​支持的函数
Expr 表示子公式表达式。

ABS(Expr)
求绝对值。

示例:ABS(C3-(D2+B3)) 结果:1500.64

AND(Expr, Expr, ….)
计算括号中的所有参数是否均为 1 或者 0

示例:AND( (C4-C3)<0, (C6-C5)>0) 结果:1

AVERAGE(Expr, Expr, …)
计算平均值

示例:AVERAGE(C3,C4,C5) 结果:73.67

COUNT(Expr)
计算括号中指定的项目的个数。

示例:COUNT(BELOW) 结果:公式单元格下方(同一列中)的单元格个数。

IF( ConditionExpr, TrueExpr, FalseExpr)
如果第一个参数 ConditionExpr > 0,则返回第二个参数 TrueExpr
如果第一个参数 ConditionExpr = 0,,则返回第三个参数 FalseExpr

示例:IF(C3>10, 100, -100) 结果:100

INT(Expr)
获取整数部分值。

示例:INT(D2+B3-C3) 结果:1500

MAX(Expr, Expr, …)
计算参数中的最大值。

示例:MAX(C3, C4, C5) 结果:90

MIN(Expr, Expr, …)
计算参数中的最小值。

示例:MIN(C3, C4, C5) 结果:42

MOD(Expr1, Expr2)
计算 Expr2 除以 Expr1 的余数。

示例:MOD(4, 2) 结果:0

NOT(Expr)
计算该参数 Expr = 1。
如果 Expr = 1,则返回 0;
如果 Expr = 0,则返回 1。

示例:NOT(C3=0) 结果:1

OR(Expr1, Expr2)
Expr1, Expr2 中有任何一个为非 0, 则返回 1, 否则返回 0。

示例:OR(C3<100, C4>40) 结果:1

ROUND(Expr1, Integer)
第二个参数 Integer 必须为整数或计算为整数。
将第一个参数 Expr 舍入到 Integer 指定的位数。
如果 Integer > 0,则将 Expr 向下舍入到指定的位数。
如果 Integer = 0,则将 Expr向下舍入到最近的整数。
如果 Integer < 0,则将 Expr向下舍入到小数点左侧。

ROUND(123.456, 2) 结果:123.46
ROUND(123.456, 0) 结果:123
ROUND(123.456, -2) 结果:100

SIGN( Expr )
计算 Expr 是大于、等于还是小于零 (0)。
如果大于零,则返回 1;
如果等于零,则返回 0;
如果小于零,则返回 -1。

示例:SIGN(-11) 结果:-1

SUM( Expr, Expr, … )
求和

例子:
SUM(LEFT)
SUM(LEFT,ABOVE,RIGHT,BELOW)
SUM(C:C)
SUM(C1:C100)


Now

公式 说明 结果
NOW() 返回当前日期和时间。 2011-11-6 19:30
NOW()-0.5 返回 12 小时前的日期和时间(-0.5 天前)。 2011-11-6 7:30
NOW()+7 返回 7 天后的日期和时间。 2011-11-13 19:30
NOW()-2.25 返回 2 天 6 小时前的日期和时间(-2.25 天前)。 2011-11-4 13:30
 

Date

 
合成日期
Date(Year, Month, Day)
 

Time

 
合成时间
Time(Hour, Minute, second)
 
 

Year

数据    
日期    
2008-7-5    
2010-7-5    
公式 描述(结果) 结果
=YEAR(A3) 单元格 A3 中日期的年份 (2008) 2008
=YEAR(A4) 单元格 A4 中日期的年份 (2010) 2010
 

Month

日期    
2011-4-15    
公式 说明 结果
MONTH(A2) 单元格 A2 中日期的月份 4
 

Day

日期    
2011-4-15    
公式 描述(结果) 结果
DAY(A2) 单元格 A2 (15) 中日期的天数 15
 

Hour

时间    
0.75    
2011-7-18 7:45    
2012-4-21    
公式 说明 结果
HOUR(A2) 返回 24 小时的 75% 18
HOUR(A3) 返回日期/时间值的小时部分。 7
HOUR(A4) 未指定时间部分的日期被视作上午 12:00 或 0 小时。 0
 
 

Minute

时间    
下午 12:45:00    
公式 说明 结果
MINUTE(A2) 返回 A2 中时间值的分钟部分。 45
 

Second

数据    
时间    
下午 4:48:18    
下午 4:48    
公式 说明 结 果
SECOND(A3) 第一个时间的秒数 (18) 18
SECOND(A4) 第二个时间的秒数 (0) 0

标签: OneNote表格里的公式计算

电脑软硬件教程网 Copyright © 2016-2030 www.computer26.com. Some Rights Reserved.