Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPSpreadsheet
»
Error, the IF function does not handle the error correctly
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
Does anyone have experien...
by
xiyi0616
[
Today
at 03:05:14 am]
Why does $fpctarget not w...
by
dbannon
[
Today
at 02:42:01 am]
"Mario & Luigi" (1994-200...
by
Gustavo 'Gus' Carreno
[
Today
at 01:46:38 am]
TMemoryStream Question wi...
by
Schmitty2005
[
Today
at 01:22:29 am]
GitHub action setup-lazar...
by
Gustavo 'Gus' Carreno
[
Today
at 01:03:07 am]
How to control subform: S...
by
Wilko500
[
Today
at 12:09:23 am]
A minor issue with the TR...
by
cdbc
[July 15, 2025, 11:44:52 pm]
activex.pp DosDateTimeToV...
by
440bx
[July 15, 2025, 11:16:33 pm]
Line Numbers, own System ...
by
Martin_fr
[July 15, 2025, 10:05:31 pm]
use Macro defines with Pa...
by
PascalDragon
[July 15, 2025, 10:03:21 pm]
generic Class for any Typ...
by
PascalDragon
[July 15, 2025, 09:53:18 pm]
Asking for an example of ...
by
marcov
[July 15, 2025, 09:39:58 pm]
Problems with libraries f...
by
regs
[July 15, 2025, 08:23:36 pm]
THUMBBUTTON does not work...
by
ASerge
[July 15, 2025, 08:10:40 pm]
Record Locked
by
Thaddy
[July 15, 2025, 07:28:38 pm]
tSQLQuery.UpdateSQL with ...
by
JRBleau
[July 15, 2025, 07:15:19 pm]
RichMemo's contents heigh...
by
dpap
[July 15, 2025, 06:13:22 pm]
Is Lazarus still serious ...
by
Thaddy
[July 15, 2025, 05:39:02 pm]
How to prevent text to be...
by
CM630
[July 15, 2025, 05:13:13 pm]
Has anyone installed TeeB...
by
Thaddy
[July 15, 2025, 05:04:07 pm]
fpc in [home] folder not ...
by
Gustavo 'Gus' Carreno
[July 15, 2025, 03:54:17 pm]
Setting up an ARM embedde...
by
Ruptor
[July 15, 2025, 03:06:39 pm]
Groupview Partial loading...
by
matthius
[July 15, 2025, 02:37:07 pm]
[Solved]Setting with hori...
by
PeterHu
[July 15, 2025, 12:32:44 pm]
[SOLVED] SQLite query to ...
by
PierceNg
[July 15, 2025, 12:29:17 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Error, the IF function does not handle the error correctly (Read 1383 times)
veb86
Jr. Member
Posts: 93
Error, the IF function does not handle the error correctly
«
on:
February 06, 2025, 07:26:49 am »
If there is an error in one of the results of the IF formula condition, then the error is shown if the condition points to this result
Example
= IF(1>0;1;#N/A) => result:1
= IF(0>1;1;#N/A) => result:#N/A
Logged
wp
Hero Member
Posts: 12910
Re: Error, the IF function does not handle the error correctly
«
Reply #1 on:
February 06, 2025, 11:04:24 am »
What did you expect? When the 1st argument is true, the formula returns the 2nd argument (1), otherwise the third argument (#N/A). That's what is happening in Excel and in FPSpreadsheet.
I don't understand how the posted sample project relates to this.
Logged
veb86
Jr. Member
Posts: 93
Re: Error, the IF function does not handle the error correctly
«
Reply #2 on:
February 06, 2025, 12:37:27 pm »
Sorry, I didn't explain it well.
Excel:
= IF(1>0;0;#N/A) => result:0
= IF(0>1;0;#N/A) => result:#N/A
FPSpreadsheet:
= IF(1>0;0;#N/A) => result:#N/A
= IF(0>1;0;#N/A) => result:#N/A
I made the example simpler and gave a screenshot
«
Last Edit: February 06, 2025, 12:39:06 pm by veb86
»
Logged
wp
Hero Member
Posts: 12910
Re: Error, the IF function does not handle the error correctly
«
Reply #3 on:
February 06, 2025, 01:49:05 pm »
Are you using a recent version of FPSpreadsheet (from ccr)? It now produces the same output as Excel. I spent lots of time during the last weeks to look at all these borderline cases and write unit tests for them.
Logged
veb86
Jr. Member
Posts: 93
Re: Error, the IF function does not handle the error correctly
«
Reply #4 on:
February 06, 2025, 02:25:07 pm »
I checked. The library has been updated to r9615.
I have attached a screenshot. My other errors have been fixed.
Logged
wp
Hero Member
Posts: 12910
Re: Error, the IF function does not handle the error correctly
«
Reply #5 on:
February 06, 2025, 05:09:15 pm »
Quote from: veb86 on February 06, 2025, 02:25:07 pm
My other errors have been fixed.
Does this mean that the IF bug is still present? It is not for me (using r9615, but this did not change anything related to this bug)
Logged
veb86
Jr. Member
Posts: 93
Re: Error, the IF function does not handle the error correctly
«
Reply #6 on:
February 06, 2025, 09:30:49 pm »
I think you have an uncommitted section of code. This happens, please check again.
My mentor also checked and he has the same error.
Logged
wp
Hero Member
Posts: 12910
Re: Error, the IF function does not handle the error correctly
«
Reply #7 on:
February 06, 2025, 10:30:54 pm »
Finally got it (recently, I had investigated error propagation in Excel, found that the first error found among the arguments usually determines the formula result, and had applied this "rule" also to the IF function). Fixed in r9620.
Logged
veb86
Jr. Member
Posts: 93
Re: Error, the IF function does not handle the error correctly
«
Reply #8 on:
February 07, 2025, 06:47:30 am »
The error has been resolved. Thank you!
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Packages and Libraries
»
FPSpreadsheet
»
Error, the IF function does not handle the error correctly
TinyPortal
© 2005-2018