Google Search Within opentiss.net

2007-04-25

计算两日期相差整年数的函数:OpenOffice.org is better

篇首语:昨天有一个以前的同事问我一些MS Excel函数/公式方面的问题,才发现OpenOffice.org有些函数比MS Excel更加实用。



计算两个日期间的(周)年数。示例中以J2为开始日期进行演示:
MS EXCEL
=IF(TODAY()<DATE(YEAR(J2)+YEAR(TODAY())-YEAR(J2),MONTH(J2),DAY(J2)),YEAR(TODAY())-YEAR(J2)-1,YEAR(TODAY())-YEAR(J2))
OpenOffice.org
=YEARS(J2;TODAY();0)
注:YEARS的第三个参数如果为0,表示相差的整年数(周年),如果为1表示相差的日历年数。
很明显,OpenOffice.org直接提供的函数简单易懂,比较实用,而如果要用MS Excel实现类似功能,需要写一串比较长的公式才行。

OpenOffice.org 2.1 中文版本帮助:
YEARS

计算两个日期之间相差的年数。
语法

YEARS(Start date, End date, Type)

Start date:开始日期

End date:第二个日期

Type:确定该差数生成的类型。有数值 0(时间间隔)和 1(日历年度)两种选择。

OpenOffice.org 2.1 Help:
YEARS

Calculates the difference in years between two dates.
Syntax

YEARS(Start date, End date, Type)

Start date: First date

End date: Second date

Type: Calculates the type of difference. Possible values are 0 (interval) and 1 (in calendar years).

16 条评论:

hello world 说...

找了半天也没找到有留言的地方,只好借个地方了。
在你的友情链接里我的博客http://www.somdo.com已经改了地址了,现在的地址是:http://www.iscodoo.com
请改一下哦。

Coach Factory 说...

burberry, abercrombie and fitch, oakley pas cher, ferragamo shoes, mulberry, air max, birkin bag, roshe run, mac cosmetics, mont blanc, abercrombie and fitch, wedding dresses, hollister, vans, supra shoes, ralph lauren, rolex watches, giuseppe zanotti, nike air max, hollister, nike huarache, louboutin, beats by dre, lancel, montre pas cher, longchamp, louis vuitton, michael kors, louis vuitton, lululemon, nike free, louis vuitton, nike roshe, hermes, juicy couture outlet, hogan, north face outlet, timberland, instyler ionic styler, ray ban pas cher, new balance shoes, ralph lauren, converse shoes, reebok outlet, juicy couture outlet, north face jackets, yoga pants, nfl jerseys, nike trainers, karen millen

Coach Factory 说...

gucci, canada goose, oakley outlet, soccer jerseys, ralph lauren, insanity, ray ban, ugg boots, moncler, chi flat iron, oakley, moncler, canada goose, oakley vault, oakley sunglasses outlet, ugg, soccer shoes, ghd, tn pas cher, canada goose, herve leger, valentino shoes, canada goose outlet, canada goose, cheap oakley sunglasses, oakley vault, canada goose outlet, babyliss pro, jimmy choo, oakley sunglasses cheap, cheap sunglasses, celine handbags, moncler, asics, moncler outlet, oakley sunglasses outlet, ugg boots, ugg boots, oakley outlet, cheap oakley sunglasses, mcm handbags, marc jacobs, oakley sunglasses cheap, louboutin, cheap sunglasses, ugg, bottega veneta, p90x, uggs on sale

Coach Factory 说...

louis vuitton outlet online, michael kors, true religion outlet, kate spade handbags, michael kors, ray ban sunglasses, oakley sunglasses, nike air max, louis vuitton handbags, oakley sunglasses, coach outlet, nike free, longchamp handbags, michael kors outlet online, longchamp outlet, prada outlet, air jordan, gucci outlet, toms shoes, louboutin, jordan shoes, nike air max, polo ralph lauren outlet, michael kors handbags clearance, kate spade outlet, coach purses, true religion, nike free, coach outlet store, polo ralph lauren outlet, ray ban sunglasses, michael kors outlet online, true religion jeans, longchamp handbags, burberry outlet online, air max, ray ban, chanel handbags, louboutin, prada handbags, coach factory, cheap michael kors, tory burch outlet, air max, oakley sunglasses, michael kors outlet, nike shoes, tiffany and co

Shijun Lin 说...

shijun 3.17
converse all star
mcm backpack
longchamp handbags
nba jerseys
gucci handbags
insanity workout
replica watches
beats by dre
cheap soccer jerseys
coach outlet online
michael kors handbags
herve leger sale
cheap oakley sunglasses
abercrombie
ray ban sunglasses
kate spade handbags
mac makeup
louis vuitton handbags
tods outlet
tiffany jewelry
salomon shoes
salomon speedcross 3
toms shoes outlet online
marc jacobs
jordan shoes
links of london uk
michael kors outlet online
m a c cosmetics
abercrombie and fitch
oakley sunglasses
coach factory outlet
adidas outlet
fitflop shoes
prada handbags
replica rolex watches
karen millen dresses
michael kors outlet online sale
fitflop sandals
thomas sabo
karen millen sale
ferragamo shoes

Lin Huang 说...

caihuanglin20150603
jordan 11 gamma blue
tod's shoes
christian louboutin
prada outlet
louis vuitton handbags
lebron james shoes
tod's shoes
nike air max
louis vuitton outlet
true religion jeans
ray ban sungalsses
ray ban sunglasses
ray ban uk
louis vuitton handbags
christian louboutin sale
jordan 11s
gucci
coach factory outlet
louis vuitton handbags
tory burch outlet
lebron james shoes 2015
michael kors
jordan retro
michael kors purse
michael kors outlet
jordan 11 concord
pandara jewelry
ray ban sunglasses outlet
ray ban sunglass
kate spade outlet
ghd hair strighteners
jordan concords
celine
oakley sunglasses cheap
jeremy scott adidas
gucci handbags
mont blanc
ray bans
michael kors outlet online
kevin durant shoes

xiaohang lin 说...

oakley sunglasses
coach outlet
michael kors outlet
ray ban sunglasses
true religion jeans
beats headphones
kate spade outlet
chanel outlet
burberry outlet
tory burch outlet
air jordan shoes
canada goose outlet
moncler coats
the north face jackets
the north face outlet
north face outlet
the north face clearance
north face jackets
the north face uk
the north face outlet store
ugg boots
mbt shoes
air jordan 13
bottega veneta outlet
hermes outlet
hermes birkin
hermes belt
mulberry outlet
tommy hilfiger outlet
juicy couture outlet
cheap wedding dresses
evening dresses
ysl outlet
mizuno running
stuart weitzman boots
dansko outlet
soccer shoes
surpa sneakers
vans shoes
nike outlet store
hang0616

Minko Chen 说...

louis vuitton handbags outlet
nba jerseys
green bay packers
michael kors handbags sale
adidas outlet
the north face outlet
nike trainers
lebron shoes
cheap nike shoes
ralph lauren outlet
ghd uk
ugg boots
coach outlet store
louis vuitton outlet online
cheap jordan shoes
air jordan shoes for sale
swarovski outlet
mulberry uk
black friday 2015
1105minko

方松腾 说...

ugg outlet store
michael kors outlet store
cyber monday
lacoste polo
uggs outlet
fitflops sale
cheap oakley sunglasses
north face jackets
michael kors outlet
gucci
wellensteyn coats
celine outlet
adidas outlet store
asics
juicy couture sale
ugg boots
tiffany jewelry
coach outlet store
oakley sunglasses
ed hardy outlet

柯云 说...

2016-01-28keyun
coach factory outlet
lebron 12
nfl jerseys
louis vuitton purses
mihchael kors outlet online sale
replica rolex watches
vans sneakers
oakley sunglasses
coach outlet store online
louis vuitton handbags
michael kors outlet online
air max 90
abercrombie and fitch
lebron james basketball shoes
louis vuitton handbags
coach outlet
hollister clearance
cheap jordans
cheap oakley sunglasses
uggs outlet
north face
oakley sunglasses wholesale
ugg outlet
louis vuitton outlet stores
polo outlet
air max 95
nfl jerseys
celine bags
louis vuitton purses
uggs on sale
hollister kids
ray ban sunglasses
michael kors outlet
kevin durant shoes
tory burch outlet
kate spade outlet
ugg boots
coach clearance
true religion jeans outlet
true religion outlet

chenlina 说...

louis vuitton bags
hogan scarpe
uggs pas cher
oakley sunglasses outlet
michael kors handbags
louis vuitton outlet
ugg boots
kevin durant shoes
michael kors outlet clearance
adidas ultra boost
ugg boots paris
coach outlet
coach outlet store online
new england patriots jerseys
michael kors handbags
air jordan pas cher
ugg boot uk
jordan shoes
mont blanc pens
christian louboutin sale
toms shoes
ralph lauren uk
fitflops
true religion outlet
louis vuitton borse
polo ralph lauren
ugg uk
toms shoes
michael kors handbags
ralph lauren
jordan 11
adidas shoes
gucci handbags
coach outlet store online
coach outlet
ugg uk
cheap jordans
uggs outlet
louis vuitton handbags
cheap ray ban sunglasses
chenlina20160831

Qinan Chen 说...

20160922qiujie
uggs
polo ralph lauren outlet
adidas nmd r1
mlb jerseys
cheap ray bans
fitflops
michael kors
canada goose outlet
michael kors outlet store
red bottom shoes for women

Unknown 说...

basketball shoes
falcons jersey
michael kors outlet
replica watches
michael kors outlet store
buffalo bills jerseys
detroit lions jerseys
arizona cardinals jerseys
lions jerseys
san antonio spurs

chenmeinv0 说...

ralph lauren outlet
ralph lauren polo outlet
michael kors outlet
nike air max
birkenstock outlet
nike air max 2016
true religion
tory burch outlet
pandora charms
adidas shoes
2017.3.13xukaimin

xumeiqing 说...

houston rockets jerseys
polo ralph lauren outlet online
louis vuitton
cheap oakley sunglasses
burberry outlet online
coach outlet
ed hardy sale
new york yankees jerseys
louboutin uk
adidas nmd
20170315huazhen

chenmeinv0 说...

michael kors
louis vuitton paris
christian louboutin uk
coach handbags
michael jordan shoes
sac longchamp
kate spade outlet
adidas stan smith
hilfiger outlet
ugg boots
20175.26chenjinyan