I'm pretty new to Excel. Here is the code
=DSUM(Table_1,"column1",INDIRECT(INDIRECT(ADDRESS(MATCH($C9,Names!B:B,0), 1, 1, , "Names"))))
which sums up all the values of column1 inside Table_1 with the matched criteria. However, if I would like to add another criteria say Table1_column_amount=1 to the DSUM, how would I possibly do that?
any help would be appreciated.
So in your setup, you have two tables:
Table_1
, the data source.Column A:
Address of the criteria range, stored as a string in the cellColumn B:
A name to lookupYou lookup a cell in the
Names
table and dereference it to get the address of the criteria range.First of all, it's good to get rid of the inner indirect/address pair, it is not required:
(Just for the sake of it, it's more readable and much faster to execute.)
Now, to the question.
You have to add the condition to the cell range which is pointed from the cell returned by the
INDEX
. You have to add a column to it, provide your new condition, and amend the stored reference so that it points to the new, extended range.You cannot just add up to that condition range by using the range union operator. Unfortunately, the
D*
set of functions require the condition range to be one single area.