Exquestions215
New Member
- Joined
- Sep 20, 2019
- Messages
- 1
Hello,
I'm trying to use a sumproduct formula to pull in data from a table with 3 criteria, but I need one criteria to reference a table. Here's an example of what I'm trying to do.
I'm trying to pull how many apples Chris sold in each state. Sheet 1
[TABLE="width: 396"]
<colgroup><col span="2"><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD]New York[/TD]
[TD]Pennsylvania[/TD]
[TD]Florida[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Apples[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]13[/TD]
[/TR]
</tbody>[/TABLE]
Here is my data table, it is by city not state. Call this sheet 2
[TABLE="width: 608"]
<colgroup><col span="4"><col><col><col><col></colgroup><tbody>[TR]
[TD]Rep[/TD]
[TD]Product[/TD]
[TD]Buffalo[/TD]
[TD]Syracuse[/TD]
[TD]Harrisburg[/TD]
[TD]Scranton[/TD]
[TD]Miami[/TD]
[TD]Tampa Bay[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Apples[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Kevin[/TD]
[TD]Bananas[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Oranges[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Ted[/TD]
[TD]Apples[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Oranges[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Apples[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]
Here is the table I need then to reference the city to each state. Table
[TABLE="width: 265"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]New York[/TD]
[TD]Pennsylvania[/TD]
[TD]Florida[/TD]
[/TR]
[TR]
[TD]Syracuse[/TD]
[TD]Harrisburg[/TD]
[TD]Miami[/TD]
[/TR]
[TR]
[TD]Buffalo[/TD]
[TD]Scranton[/TD]
[TD]Tampa Bay
[/TD]
[/TR]
</tbody>[/TABLE]
I can do a sumproduct formula like this =SUMPRODUCT((Sheet2!B2:H7)*(Sheet2!A1:A7=Sheet1!A2)*(Sheet2!B1:B7=Sheet1!B2)*(Sheet2!A1:H1=Sheet1!C3),(C3 being a city not a state) that I could reference a city to work, but I can't seem to get it to reference the state table to pull in a city at once.
Any ideas, I've tried doing an index match as the third condition referencing the state table but have had no luck.
Thanks!
I'm trying to use a sumproduct formula to pull in data from a table with 3 criteria, but I need one criteria to reference a table. Here's an example of what I'm trying to do.
I'm trying to pull how many apples Chris sold in each state. Sheet 1
[TABLE="width: 396"]
<colgroup><col span="2"><col><col><col></colgroup><tbody>[TR]
[TD] [/TD]
[TD] [/TD]
[TD]New York[/TD]
[TD]Pennsylvania[/TD]
[TD]Florida[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Apples[/TD]
[TD="align: right"]13[/TD]
[TD="align: right"]14[/TD]
[TD="align: right"]13[/TD]
[/TR]
</tbody>[/TABLE]
Here is my data table, it is by city not state. Call this sheet 2
[TABLE="width: 608"]
<colgroup><col span="4"><col><col><col><col></colgroup><tbody>[TR]
[TD]Rep[/TD]
[TD]Product[/TD]
[TD]Buffalo[/TD]
[TD]Syracuse[/TD]
[TD]Harrisburg[/TD]
[TD]Scranton[/TD]
[TD]Miami[/TD]
[TD]Tampa Bay[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Apples[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Kevin[/TD]
[TD]Bananas[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Oranges[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD]Ted[/TD]
[TD]Apples[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD]Mike[/TD]
[TD]Oranges[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]7[/TD]
[TD="align: right"]8[/TD]
[/TR]
[TR]
[TD]Chris[/TD]
[TD]Apples[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]
Here is the table I need then to reference the city to each state. Table
[TABLE="width: 265"]
<colgroup><col><col><col></colgroup><tbody>[TR]
[TD]New York[/TD]
[TD]Pennsylvania[/TD]
[TD]Florida[/TD]
[/TR]
[TR]
[TD]Syracuse[/TD]
[TD]Harrisburg[/TD]
[TD]Miami[/TD]
[/TR]
[TR]
[TD]Buffalo[/TD]
[TD]Scranton[/TD]
[TD]Tampa Bay
[/TD]
[/TR]
</tbody>[/TABLE]
I can do a sumproduct formula like this =SUMPRODUCT((Sheet2!B2:H7)*(Sheet2!A1:A7=Sheet1!A2)*(Sheet2!B1:B7=Sheet1!B2)*(Sheet2!A1:H1=Sheet1!C3),(C3 being a city not a state) that I could reference a city to work, but I can't seem to get it to reference the state table to pull in a city at once.
Any ideas, I've tried doing an index match as the third condition referencing the state table but have had no luck.
Thanks!