Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177993
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:26:59+00:00 2026-06-17T17:26:59+00:00

As part of the Formula.js project, I’m trying to re-implement Excel’s ACCRINT function (in

  • 0

As part of the Formula.js project, I’m trying to re-implement Excel’s ACCRINT function (in JavaScript, but the language should not matter). I’ve been trying to find a proper description for how it’s supposed to work (especially with respect to the first_interest parameter), but could not find anything.

Interestingly enough, Excel, Google Spreadsheets, Apple Numbers, Gnumeric, and OpenOffice all disagree on the way to implement it, even though all three major versions of Excel (Win, Mac, Web) seem to agree with each other. Some more context can be found on this blog post.

Dozens of tests cases and my current (flawed) implementation can be found here.

Any help would be greatly appreciated!

UPDATE: to be clear, the issue is not related to the day count convention, which we implemented using David Wheeler’s pseudocode for YEARFRAC, which itself was validated by over 32 million tests, covering all five basis options. The issue comes from the first_interest parameter, which nobody seems to really understand. As far as we can tell, this parameter is simply ignored by many alternative spreadsheets, including OpenOffice (it’s commented out in the source code). And this parameter really behaves in strange ways. If you use Excel and you change its value, you will see that it will change the results given by the ACCRINT function, but in ways that seem chaotic. Try changing the first_interest date by a full century, and you’ll see the accrued interest changing, but not by much. I really can’t make sense of that. If anyone can, I’m all ears…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:27:00+00:00Added an answer on June 17, 2026 at 5:27 pm

    Phil H from Quantitative Finance found this .NET library, which provides clean room implementations for all Financial Functions, and all but two seem to pass the test (201,349 test cases in fact). These include ACCRINT. The code is licensed under Creative Commons Attribution. It’s written in F#, but it’s pretty clear. The code for ACCRINT is in the bonds.fs file. We will try to port it to JavaScript and see if we get the same results as what Excel returns. More on this soon…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our project we need to implement Excel-like grid for web, which will look
I'm trying to replicate a formula from an Excel worksheet onto an ASP page,
I'm trying to implement the Window Width and level formula from de Dicom specification
i'm attempting to build a tiny (or perhaps not so tiny) formula that will
I am having trouble constructing a unusual lookup formula in Excel. Normally, I would
I am trying to look up a cell based on the following formula: =vlookup(large($A$2:$A$10,1),$A$2:$C$10,3,false)
can someone please translate this excel spreadsheet cell formula in english words ? =ROUND(IF(F28
I'm trying to populate a cell with a basic formula that references both the
I'm writing a shopping cart in PHP, and part of its function is to
I am trying to join 2 tables, but only join with the latest record

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.