Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Alternate for MS-Excel EDATE function in HSSFWorkbook, POI ? - Urgent help needed.

 
Jay Vaghela
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MS Excel's EDATE function is yet not included in the latest version of POI 3.7, So is there any alternate of using EDATE function or any solution?
 
Jay Vaghela
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the answer, and its (Start_Date) - 1/1/1900 +366
For 12 months its +366
for 6 its +182 etc etc
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may wish to read Why are the Microsoft Office file formats so complicated? (And some workarounds) in order to learn about the "1/1/1900" part, and then check that POI does the right thing. (After reading the article you'll understand what I mean.)
 
Jay Vaghela
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand what you ment to say, But then what should be the option? Is there any alternate in ms-excel itself? I mean by combining multiple function of excel can we achive the EDATE?

I found that above code will not work with Leap year but still I have some workaround, Not sure about any unforseen result.
 
Jay Vaghela
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martijin,
The absolute answer is still not found, please keep this thread open.
 
Jay Vaghela
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jay Vaghela wrote:I found the answer, and its (Start_Date) - 1/1/1900 +366
For 12 months its +366
for 6 its +182 etc etc


Now I just extracted month and date and added 12 months for EDATE(B2,12), dont know the flip side.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic