Bug 156572 - tbillyield() calculation returns incorrect yields for some dates
Summary: tbillyield() calculation returns incorrect yields for some dates
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Cell-Formula
  Show dependency treegraph
 
Reported: 2023-08-01 20:31 UTC by fwomail
Modified: 2025-08-06 03:09 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
tbillyield() does not match Excel formula and generates inconsistent numbers (19.48 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-08-01 20:31 UTC, fwomail
Details

Note You need to log in before you can comment on or make changes to this bug.
Description fwomail 2023-08-01 20:31:22 UTC
Created attachment 188708 [details]
tbillyield() does not match Excel formula and generates inconsistent numbers

tbillyield() returns inconsistent sometimes incorrect yield values depending on the dates used, even though the number of days are the same.
For example:
settle	        mature	      days	price	tbillyield()	computed
01/17/23	02/28/23	42	99.384	5.3127%	5.3127%
01/24/23	03/07/23	42	99.384	5.0712%	5.3127%
01/31/23	03/14/23	42	99.384	4.9585%	5.3127%
The computed column uses the microsoft formula for tbillyield() is describe in https://support.microsoft.com/en-us/office/tbillyield-function-6d381232-f4b0-4cd5-8e97-45b9c03468ba
tbillyield should produce the same value if the number of days and price
are the same.
Loading the same exact *.ods file into Excel produces correct values for tbillyeild() that matches the same computed values.
So, LibreOffice is computing tbillyield() incorrectly.
I hope other's aren't relying on this financial formula for their decisions.
Comment 1 m_a_riosv 2023-08-02 01:13:33 UTC
Reproducible, same result with Google sheets and Excel, different in calc.
Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2a9e83a673300dfe15a3acc66acd560b2a7cae43
CPU threads: 16; OS: Windows 10.0 Build 22621; UI render: default; VCL: win
Locale: es-ES (es_ES); UI: en-US Calc: CL threaded
Comment 2 Aron Budea 2023-08-06 22:14:58 UTC
Already in OO 3.3.0.
Comment 3 QA Administrators 2025-08-06 03:09:50 UTC
Dear fwomail,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug