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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
This is me back in Lazaru...
by
JD
[
Today
at 08:38:12 pm]
Win11 - How to start cons...
by
dculp
[
Today
at 08:21:22 pm]
First it's a square, then...
by
Fred vS
[
Today
at 08:20:11 pm]
2d "platform" game sugges...
by
TBMan
[
Today
at 08:18:00 pm]
FPC 3.2.2 using Result wi...
by
Remy Lebeau
[
Today
at 08:07:23 pm]
accessing array members i...
by
TRon
[
Today
at 08:05:23 pm]
problem with easylazfreet...
by
Bart
[
Today
at 06:40:34 pm]
looping direction control...
by
MarkMLl
[
Today
at 06:12:27 pm]
My kernel cannot response...
by
TYDQ
[
Today
at 04:23:48 pm]
ERROR:Generating PIC, but...
by
TYDQ
[
Today
at 04:22:45 pm]
Forum slow for others as ...
by
PascalDragon
[
Today
at 02:58:59 pm]
Feature announcement: Fun...
by
PascalDragon
[
Today
at 02:53:37 pm]
FPC 3.2.2 fpc_chararray_t...
by
PascalDragon
[
Today
at 02:47:47 pm]
Rainbow Dots Animated in ...
by
Boleeman
[
Today
at 02:46:39 pm]
Doing C-like linking of m...
by
PascalDragon
[
Today
at 02:38:39 pm]
Edmond Harris Spiral: Ver...
by
Boleeman
[
Today
at 02:37:32 pm]
Testing with SQLite3DataS...
by
CharlyTango
[
Today
at 02:13:34 pm]
Silver Pascal Coder - Lat...
by
silvercoder70
[
Today
at 01:23:50 pm]
[SOLVED] SQLite3 REINDEX
by
CharlyTango
[
Today
at 12:22:22 pm]
Is this Stupid? What do y...
by
JD
[
Today
at 11:53:26 am]
Amoeba Animated: Not that...
by
Dzandaa
[
Today
at 11:35:43 am]
THashedStringList - do we...
by
Thaddy
[
Today
at 09:53:43 am]
Managing linked list as i...
by
cdbc
[
Today
at 08:30:34 am]
Default Component Size mi...
by
SandyG
[
Today
at 04:47:08 am]
in-memory machine code ge...
by
440bx
[
Today
at 02:47:19 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Error, the IF function does not handle the error correctly (Read 1095 times)
veb86
Jr. Member
Posts: 92
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: 12754
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: 92
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: 12754
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: 92
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: 12754
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: 92
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: 12754
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: 92
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