Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Compare multiple ranges using sumproduct

Posted on 2011-03-02
Medium Priority
229 Views
I am trying to use SUMPRODUCT in Excel to compare mulitple ranges but cannot get the calculation to evaulate successfully.

Firstly I want a column to be within a specific date range (this I have no problem with) then the other column I am evaluating I want to be one of a list of values (this is causing me trouble)

I attach a example of the code which I have unsuccessfully tried.

Columns AW and L are date ranges and B is populated by the multiple value range.

I appreciate that I could create a seperate SUMPRODUCT statement for each value I wish to evaluate but I hoped that there was a more efficient way of calculating this.
``````=SUMPRODUCT(([data.xls]PM!\$AW\$2:\$AW\$65000>=L3)*([data.xls]PM!\$AW\$2:\$AW\$65000<L4)*([data.xls]PM!\$B\$2:\$B\$65000="Assigned" + [data.xls]PM!\$B\$2:\$B\$65000="Assigned To Vendor"))
``````
0
Question by:JayceW
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
• 2

LVL 85

Assisted Solution

Rory Archibald earned 1720 total points
ID: 35016757
Try:
=SUMPRODUCT(([data.xls]PM!\$AW\$2:\$AW\$65000>=L3)*([data.xls]PM!\$AW\$2:\$AW\$65000<L4)*(([data.xls]PM!\$B\$2:\$B\$65000="Assigned")+([data.xls]PM!\$B\$2:\$B\$65000="Assigned To Vendor")))
0

LVL 85

Accepted Solution

Rory Archibald earned 1720 total points
ID: 35016764
Or:
=SUMPRODUCT(([data.xls]PM!\$AW\$2:\$AW\$65000>=L3)*([data.xls]PM!\$AW\$2:\$AW\$65000<L4)*([data.xls]PM!\$B\$2:\$B\$65000={"Assigned","Assigned To Vendor"}))
0

LVL 9

Assisted Solution

McOz earned 280 total points
ID: 35016831
If you have your list of values in a range somewhere, you could use something like this (where "YourListRange" is a valid reference to your list):
``````=SUMPRODUCT((\$AW\$2:\$AW\$65000>=L3)*(\$AW\$2:\$AW\$65000<L4)*(IsError(Match(\$B\$2:\$B\$65000,YourListRange,0))=FALSE))
``````
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.
###### Suggested Courses
Course of the Month8 days, 22 hours left to enroll