aspose file tools*
The moose likes Other Open Source Projects and the fly likes Alternate for MS-Excel EDATE function in HSSFWorkbook, POI ? - Urgent help needed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Alternate for MS-Excel EDATE function in HSSFWorkbook, POI ? - Urgent help needed." Watch "Alternate for MS-Excel EDATE function in HSSFWorkbook, POI ? - Urgent help needed." New topic
Author

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

Jay Vaghela
Greenhorn

Joined: Feb 15, 2006
Posts: 22
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

Joined: Feb 15, 2006
Posts: 22
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
Marshal

Joined: Mar 22, 2005
Posts: 39549
    
  27
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.)


Ping & DNS - updated with new look and Ping home screen widget
Jay Vaghela
Greenhorn

Joined: Feb 15, 2006
Posts: 22
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

Joined: Feb 15, 2006
Posts: 22
Hi Martijin,
The absolute answer is still not found, please keep this thread open.
Jay Vaghela
Greenhorn

Joined: Feb 15, 2006
Posts: 22
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Alternate for MS-Excel EDATE function in HSSFWorkbook, POI ? - Urgent help needed.
 
Similar Threads
Enable Autofilter option in Excel
Newbie need help with textfield value.
2 functions at onsubmit
how to insert a file object in excel sheet using java
Jakarta POI