Sep 02 2020 08:28 PM
Looking for advice on a formula to exclude a certain ID from the broader data on what I've labeled Sheet2. The formula that doesn't work is below, but I think it indicates what I'm trying to do. Not quite sure how to accomplish this, so any guidance would be appreciated.
=INDEX('Sheet2'!F:F,MATCH([@category]&[@[ctry]]&('Sheet2'!B:B<>[@[ID]]),'Sheet2'!C:C&'Sheet2'!D:D,0))
Sep 02 2020 10:19 PM
Sep 09 2020 12:18 PM
@JMB17 Thank you; however, that didn't quite work. I've attached a spreadsheet using the formula you suggested. I'd like to sum all of the values drawn from sheet 2 that match the category and ctry fields but excludes amounts related to the ID from Sheet 1. Suggestions would be appreciated.
Sep 09 2020 02:05 PM
Here
it could be
=SUMPRODUCT(
($B$2:$B$71=G2)*
($C$2:$C$71=H2)*
(COUNTIF(Sheet1!$A$2:$A$11,$A$2:$A$71)=0)*
$D$2:$D$71
)
Sep 09 2020 06:16 PM
Solution
It's a little bit clearer what you're trying to do. The index/match formula in your original post is indicative of a lookup function, not a sum function.
But, it still depends on whether you want to exclude the entries where the ID, Category, and Ctry match Sheet1, or exclude all entries on Sheet2 where the ID matches any of the ID's listed on Sheet1 regardless of Category and Ctry. I believe both scenarios yield the same results, but I don't know if that may always be true.
I attached a file with examples for both. Though the second example should yield the same results as what Sergei has already suggested.
Sep 11 2020 02:36 PM
Sep 09 2020 06:16 PM
Solution
It's a little bit clearer what you're trying to do. The index/match formula in your original post is indicative of a lookup function, not a sum function.
But, it still depends on whether you want to exclude the entries where the ID, Category, and Ctry match Sheet1, or exclude all entries on Sheet2 where the ID matches any of the ID's listed on Sheet1 regardless of Category and Ctry. I believe both scenarios yield the same results, but I don't know if that may always be true.
I attached a file with examples for both. Though the second example should yield the same results as what Sergei has already suggested.