Hello everybody,
I have a worksheet called "Sales" which is built as a small database with a fixed number of columns (22) and around 200 rows for the moment (will increase in the future). This range is called "ALLDATA". The data itself starts at row 3; row 2 (TOPROW) only contains parameters that refer to the letter of the column and to the number of lines in ALLDATA, so for example I will have the following :
Row 2, column A -> ="$A"&ROWS(ALLDATA),
Row 2, column B -> ="$B"&ROWS(ALLDATA)
Etc.
What I am trying to do is retrieve data from column L of this sheet and sum it in sheet "Analysis" based on two conditions : product name (col D of "Sales") and type (col C) and I am using "sumproduct" for that, but for some reason, the following isn't working -
=SUMPRODUCT(((Sales!$C4:INDEX(TOPROW,0,3))="1")*((Sales!$D4:INDEX(TOPROW,0,4))=D10),((Sales!$L4:INDEX(TOPROW,0,12))))
Since the number of rows in "Sales" varies on a regular basis, I don't want to hard-code anything in the formula, but it seems that the problem comes from combining "sumproduct" and "index" in the same formula, and my question is how could I make this work?
Any help will be appreciated,
Thanks,
Dalian
I have a worksheet called "Sales" which is built as a small database with a fixed number of columns (22) and around 200 rows for the moment (will increase in the future). This range is called "ALLDATA". The data itself starts at row 3; row 2 (TOPROW) only contains parameters that refer to the letter of the column and to the number of lines in ALLDATA, so for example I will have the following :
Row 2, column A -> ="$A"&ROWS(ALLDATA),
Row 2, column B -> ="$B"&ROWS(ALLDATA)
Etc.
What I am trying to do is retrieve data from column L of this sheet and sum it in sheet "Analysis" based on two conditions : product name (col D of "Sales") and type (col C) and I am using "sumproduct" for that, but for some reason, the following isn't working -
=SUMPRODUCT(((Sales!$C4:INDEX(TOPROW,0,3))="1")*((Sales!$D4:INDEX(TOPROW,0,4))=D10),((Sales!$L4:INDEX(TOPROW,0,12))))
Since the number of rows in "Sales" varies on a regular basis, I don't want to hard-code anything in the formula, but it seems that the problem comes from combining "sumproduct" and "index" in the same formula, and my question is how could I make this work?
Any help will be appreciated,
Thanks,
Dalian