Skip to content

This closes #2445, fix incorrect if result when third arg is missing - #2446

Merged
xuri merged 1 commit into
qax-os:masterfrom
Aprax14:fix-if-false-result
Oct 9, 2026
Merged

xuri merged 1 commit into
qax-os:masterfrom
Aprax14:fix-if-false-result

Conversation

@Aprax14

@Aprax14 Aprax14 commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

PR Details

Description

Make the IF function return FALSE when the condition is false and third argument is omitted. Before this change, it returned an empty string.

Related Issue

#2445

Motivation and Context

Excel returns FALSE in expressions like =IF(1=2,1). Excelize returned an empty string instead, so the result could not be used in arithmetic expressions: IF(1=2,1,IF(1=2,1))*2 returned #VALUE! instead of 0.

How Has This Been Tested

Added unit tests

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov

codecov Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.72%. Comparing base (1cf5392) to head (5db21b8).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2446   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files          32       32           
  Lines       32527    32528    +1     
=======================================
+ Hits        32437    32438    +1     
  Misses         88       88           
  Partials        2        2           
Flag Coverage Δ
unittests 99.72% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@xuri xuri added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 9, 2026

@xuri xuri left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks for your contribution.

@xuri
xuri merged commit 958cda5 into qax-os:master Oct 9, 2026
15 checks passed
@xuri xuri linked an issue Oct 9, 2026 that may be closed by this pull request
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

Status: Bugfix

Development

Successfully merging this pull request may close these issues.

IF returns an empty string instead of FALSE when third arg is omitted

2 participants