Age calculation error with year()- today()- and month()


#1

We have a spreadsheet do bunch of calculations, and one cell has a formula calculating a person's age from DOB and today's date:

=YEAR(TODAY())-YEAR(C2)+IF(DATE(2001,MONTH(C2),DAY(C2))>DATE(2001,MONTH(TODAY()),DAY(TODAY())),-1,0)

When I compare the result of aspose.cell and excel, aspose always gives a wrong result of one year shorter than excel's.

Looks like bug. Has it been reported and fixed? Thanks.

Colin


#2

Hi Colin,

Are you using Aspose.Cells for Java? Please send your sample file and test code to nanjing@aspose.com. Thank you.


#3

Laurance,

I have sent you the test files. It is a problem with Date() function in Aspose. For example Date(2001, 10, 1) should be 10/1/2001, but Aspose gives us 1/1/2001.

Colin


#4

Hi Colin,

I got your files. We will check and fix it ASAP.


#5

Hi,

If you are using Aspose.Cells for Java , please try this fix .


#6

Warren:

Thanks for the quick response. While this build fixed the date() problem, it appears to be a bad build, since the vlookup is completed messed up. The problem is with both jdk 1.4 and 1.5 versions. I attached the test files.

Sheet2.C4 should be 100000. Aspose.Cell gives us 200000.

The previouse build 4.0.3.0 does not have this problem.

Colin


#7

Hi,

Please try this fix.


#8

That fixed it. Thanks for the attention. Will all these fixes go to an official release soon? Can we get notified? We are evaluating a few packages including Aspose.Cell and will make a recommandation soon.


#9

Hi,

We will release new version at the end of this week.You can see release info in the blogs.