Solved

# SUMPRODUCT function

Posted on 2011-03-08
369 Views
I am trying to use the  SUMPRODUCT function but it's new to me.  The key formula is in cell E22.  I am trying to sum the values in the range C6:R9 for all values that are greater than the year 2010 and less than the variable year in B21.

As it is, it will only sum the values in one row for the range C6:R6.  How can I fix this?
Exp-Analysis.xls
0
Question by:johnnyloff

LVL 50

Accepted Solution

barry houdini earned 250 total points
Hello johnnyloff,

try this with small syntax change

=SUMPRODUCT(C6:R9*(2010<B21)*(C4:R4>=2010)*(C4:R4<=B21))

regards, barry
0

LVL 50

Expert Comment

....I don't think you need (2010<B21) either, so you can use just

=SUMPRODUCT(C6:R9*(C4:R4>=2010)*(C4:R4<=B21))

barry
0

LVL 16

Expert Comment

=SUMPRODUCT(C6:R6*(C4:R4>=2010)*(C4:R4<=B21))
0

Author Closing Comment

Perfect.
0

LVL 39

Expert Comment

you don't really need the 2010<B21 part, so you can do with

=SUMPRODUCT(C6:R6,((C4:R4>=2010)*(C4:R4<=B21)))

This will only return row 6, if you want more row, you need to add more sumproducts.

=SUMPRODUCT(C6:R6,((C4:R4>=2010)*(C4:R4<=B21)))+SUMPRODUCT(C7:R7,((C4:R4>=2010)*(C4:R4<=B21)))

etc

Or am I missing part of your question,

THomas
0

## Featured Post

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
INDEX and MATCH can be used to great effect to replace HLOOKUP and VLOOKUP as it does not have the limitation of needing the data to be sorted so that the reference value is in the first column or row. It also has the ability to perform a bi-directi…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
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 …