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
Recent
StrMath.pas a String Numb...
by
JgQDev
[
Today
at 05:56:44 am]
Debian removes FPC/Lazaru...
by
dbannon
[
Today
at 05:47:10 am]
Published sets in FPC are...
by
Thausand
[
Today
at 05:14:26 am]
lazarus project
by
crownfield
[
Today
at 03:34:00 am]
Frustrating Error When us...
by
jamie
[
Today
at 03:05:27 am]
'Rounding' to (say) 5 DP
by
LV
[February 17, 2026, 11:51:29 pm]
Is it possible to create ...
by
LeP
[February 17, 2026, 11:20:42 pm]
Status of FPC 3.4.0 or FP...
by
PascalDragon
[February 17, 2026, 09:25:01 pm]
MVP made easier.
by
cdbc
[February 17, 2026, 09:16:07 pm]
A diary project with SQLi...
by
cdbc
[February 17, 2026, 09:03:25 pm]
[ANN] fpGUI Toolkit v2.0....
by
PascalDragon
[February 17, 2026, 08:49:17 pm]
Form has no Taskbar entry...
by
n7800
[February 17, 2026, 07:48:59 pm]
DCPcrypt v2.0.6 — Cryptog...
by
Ten_Mile_Hike
[February 17, 2026, 07:40:22 pm]
[SOLVED] Lazarus recompil...
by
creaothceann
[February 17, 2026, 07:37:12 pm]
4.4 messed with the proje...
by
QEnnay
[February 17, 2026, 07:26:00 pm]
Anyone else getting a tro...
by
dseligo
[February 17, 2026, 07:24:37 pm]
Duplicated icon in the Wi...
by
n7800
[February 17, 2026, 06:11:54 pm]
[AGGPas] Difference betwe...
by
cdbc
[February 17, 2026, 05:02:28 pm]
[SOLVED] Statically linki...
by
marcov
[February 17, 2026, 04:56:09 pm]
pas2js WebAssembly SQLite...
by
PierceNg
[February 17, 2026, 03:32:46 pm]
My AGGPas examples
by
Roland57
[February 17, 2026, 02:10:03 pm]
Datatype of Fields in sql...
by
Dzandaa
[February 17, 2026, 01:46:59 pm]
TurboBird IBX
by
valdir.marcos
[February 17, 2026, 10:38:16 am]
Delphi Magazine issues 1-...
by
valdir.marcos
[February 17, 2026, 10:37:33 am]
We are starting to use La...
by
dbannon
[February 17, 2026, 06:25:04 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Error, the IF function does not handle the error correctly (Read 2041 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: 13363
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: 13363
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: 13363
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: 13363
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