Formula to sumif a column and all corresponding values in a table, if it matches a condition/s in another table

tyrese215

New Member
Joined
Feb 25, 2009
Messages
33
[TABLE="width: 589"]
<tbody>[TR]
[TD]Table 1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Metric1 (Unique)[/TD]
[TD]Jan-17[/TD]
[TD]Feb-17[/TD]
[TD]Mar-17[/TD]
[TD]Apr-17[/TD]
[TD]May-17[/TD]
[TD]Jun-17[/TD]
[TD]Jul-17[/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]D[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]F[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Table 2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Metric1[/TD]
[TD]Month[/TD]
[TD]Metric2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Jan-17[/TD]
[TD="align: right"]166[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Apr-17[/TD]
[TD="align: right"]129[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Jan-17[/TD]
[TD="align: right"]215[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Apr-17[/TD]
[TD="align: right"]136[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Mar-17[/TD]
[TD="align: right"]506[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Feb-17[/TD]
[TD="align: right"]209[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Feb-17[/TD]
[TD="align: right"]191[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]Mar-17[/TD]
[TD="align: right"]427[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]E[/TD]
[TD]Jun-17[/TD]
[TD="align: right"]253[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]F[/TD]
[TD]Jan-17[/TD]
[TD="align: right"]469[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Jul-17[/TD]
[TD="align: right"]495[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]B[/TD]
[TD]Jan-17[/TD]
[TD="align: right"]168[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Jul-17[/TD]
[TD="align: right"]553[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Jan-17[/TD]
[TD="align: right"]161[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]Apr-17[/TD]
[TD="align: right"]244[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Mar-17[/TD]
[TD="align: right"]154[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Feb-17[/TD]
[TD="align: right"]291[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Mar-17[/TD]
[TD="align: right"]518[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Mar-17[/TD]
[TD="align: right"]529[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Mar-17[/TD]
[TD="align: right"]158[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Feb-17[/TD]
[TD="align: right"]421[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]A[/TD]
[TD]Feb-17[/TD]
[TD="align: right"]361[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col span="7"></colgroup>[/TABLE]


In table 2 above I have multiple instances of the same “Metric1”. Beside this column I have the month that this metric relates too, and the value of the metric in column C. This table 2 would be a dynamic dataset that will expand in terms of the number of rows.

I want to summarize this Table 2 into a Table 1 view.

In table 1, I have unique instances of all Metric1, and the months going across row 2. I need a dynamic formula I can place in all the green cells that will Sumif all metric1, and place the total if it matches the date in row 2 above.

Thank you heaps
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
To get this, I created a simple Pivot Table.

Data Range
[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[TD]
C
[/TD]
[TD]
D
[/TD]
[TD]
E
[/TD]
[TD]
F
[/TD]
[TD]
G
[/TD]
[TD]
H
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
Sum of Metric2​
[/TD]
[TD]
Column Labels​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
Row Labels​
[/TD]
[TD]
1/17/18​
[/TD]
[TD]
2/17/18​
[/TD]
[TD]
3/17/18​
[/TD]
[TD]
4/17/18​
[/TD]
[TD]
6/17/18​
[/TD]
[TD]
7/17/18​
[/TD]
[TD]
Grand Total​
[/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
A​
[/TD]
[TD]
166​
[/TD]
[TD]
1473​
[/TD]
[TD]
1359​
[/TD]
[TD]
129​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
3127​
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
B​
[/TD]
[TD]
383​
[/TD]
[TD][/TD]
[TD]
506​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
495​
[/TD]
[TD]
1384​
[/TD]
[/TR]
[TR]
[TD]
7
[/TD]
[TD]
C​
[/TD]
[TD]
161​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
380​
[/TD]
[TD][/TD]
[TD]
553​
[/TD]
[TD]
1094​
[/TD]
[/TR]
[TR]
[TD]
8
[/TD]
[TD]
E​
[/TD]
[TD][/TD]
[TD][/TD]
[TD]
427​
[/TD]
[TD][/TD]
[TD]
253​
[/TD]
[TD][/TD]
[TD]
680​
[/TD]
[/TR]
[TR]
[TD]
9
[/TD]
[TD]
F​
[/TD]
[TD]
469​
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]
469​
[/TD]
[/TR]
[TR]
[TD]
10
[/TD]
[TD]
Grand Total​
[/TD]
[TD]
1179​
[/TD]
[TD]
1473​
[/TD]
[TD]
2292​
[/TD]
[TD]
509​
[/TD]
[TD]
253​
[/TD]
[TD]
1048​
[/TD]
[TD]
6754​
[/TD]
[/TR]
</tbody>[/TABLE]


Pivot Tables are on the Insert Tab of the Ribbon. Metric 1 as Rows, Months as Columns, Metric 2 as Values.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,908
Messages
6,175,307
Members
452,633
Latest member
DougMo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top