Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUMIFS with multiple conditions (fixes #704) #710

Closed
wants to merge 10 commits into from

Conversation

marcusblevin
Copy link
Contributor

@marcusblevin marcusblevin commented Oct 8, 2018

Cell's were summed multiple times if it matched several conditions whereas should only sum once

This is:

- [x] a bugfix
- [ ] a new feature

Checklist:

Why this change is needed?

If only one condition is provided, the range is summed correctly. If multiple conditions are provided the sum is inaccurate. It seems that a cell is summed multiple times if it matches the several conditions whereas it should only sum it once, even if matching several times.

Cell's were summed multiple times if it matched several conditions whereas should only sum once
@PowerKiKi PowerKiKi self-requested a review October 21, 2018 03:09
Copy link
Member

@PowerKiKi PowerKiKi left a comment

Choose a reason for hiding this comment

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

That looks like a good start. Unit tests are missing though. You should be able to add a few cases to cover your code in data/Calculation/MathTrig/SUMIF.php

@PowerKiKi PowerKiKi closed this in 98d1047 Oct 28, 2018
@PowerKiKi
Copy link
Member

Merged, thanks !

guillaume-ro-fr pushed a commit to guillaume-ro-fr/PhpSpreadsheet that referenced this pull request Jun 12, 2019
Values were summed multiple times if it matched several conditions
whereas it should only be summed once.

Fixes PHPOffice#704
Fixes PHPOffice#710
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants