• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic