How to find and SUM Multiple Column Data by two criteria?

knaabis

Active Member
Joined
Apr 25, 2006
Messages
254
Office Version
  1. 2013
Platform
  1. Windows
<style type="text/css">
table.tableizer-table {
font-size: 12px;
border: 1px solid #CCC ;
font-family: Arial, Helvetica, sans-serif;
}
.tableizer-table td {
padding: 4px;
margin: 3px;
border: 1px solid #CCC ;
}
.tableizer-table th {
background-color: #104E8B ;
color: #FFF ;
font-weight: bold;
}
</style>
<table class="tableizer-table">
<thead><tr class="tableizer-firstrow"><th></th><th>w</th><th>e</th><th>w</th><th>k</th><th>w</th></tr></thead><tbody>
<tr><td>A</td><td>10</td><td>5</td><td>20</td><td>4</td><td>8</td></tr>
<tr><td>B</td><td>9</td><td>4</td><td>5</td><td>4</td><td>2</td></tr>
<tr><td>C</td><td>11</td><td>3</td><td>18</td><td>9</td><td>7</td></tr>
<tr><td>D</td><td>8</td><td>2</td><td>10</td><td>3</td><td>4</td></tr>
<tr><td>E</td><td>25</td><td>1</td><td>3</td><td>3</td><td>5</td></tr>
<tr><td>F</td><td>3</td><td>1</td><td>3</td><td>3</td><td>5</td></tr>
</tbody></table>

I need SUM by two parameters - in Row side (for example) parameter A and for Column side parameter W.
Result will be 38.
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hello,

With your table located in range A1:F7, you can have following Array Formula:

=SUM(IF(B1:F1="w",OFFSET((B1:F1),MATCH("A",A2:A7,0),0),0))

Hope this will help
 
Upvote 0
Another option


Book1
HIJKLMNOP
3wewkww
4A1052048A38
5B94542
6C1131897
7D821034
8E251335
9F31335
Sheet1
Cell Formulas
RangeFormula
P4=SUMPRODUCT((H4:H9=O4)*(I3:M3=P3)*(I4:M9))
 
Upvote 0
Or


[Table="class: grid"][tr][td="bgcolor: #DCE6F1"][/td][td="bgcolor: #DCE6F1"]
A
[/td][td="bgcolor: #DCE6F1"]
B
[/td][td="bgcolor: #DCE6F1"]
C
[/td][td="bgcolor: #DCE6F1"]
D
[/td][td="bgcolor: #DCE6F1"]
E
[/td][td="bgcolor: #DCE6F1"]
F
[/td][td="bgcolor: #DCE6F1"]
G
[/td][td="bgcolor: #DCE6F1"]
H
[/td][td="bgcolor: #DCE6F1"]
I
[/td][td="bgcolor: #DCE6F1"]
J
[/td][/tr]
[tr][td="bgcolor: #DCE6F1"]
1
[/td][td][/td][td]
w​
[/td][td]
e​
[/td][td]
w​
[/td][td]
k​
[/td][td]
w​
[/td][td][/td][td]
Crit1​
[/td][td]
Crit2​
[/td][td]
Result​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
2
[/td][td]
A​
[/td][td]
10​
[/td][td]
5​
[/td][td]
20​
[/td][td]
4​
[/td][td]
8​
[/td][td][/td][td]
A​
[/td][td]
w​
[/td][td]
38​
[/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
3
[/td][td]
B​
[/td][td]
9​
[/td][td]
4​
[/td][td]
5​
[/td][td]
4​
[/td][td]
2​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
4
[/td][td]
C​
[/td][td]
11​
[/td][td]
3​
[/td][td]
18​
[/td][td]
9​
[/td][td]
7​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
5
[/td][td]
D​
[/td][td]
8​
[/td][td]
2​
[/td][td]
10​
[/td][td]
3​
[/td][td]
4​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
6
[/td][td]
E​
[/td][td]
25​
[/td][td]
1​
[/td][td]
3​
[/td][td]
3​
[/td][td]
5​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
7
[/td][td]
F​
[/td][td]
3​
[/td][td]
1​
[/td][td]
3​
[/td][td]
3​
[/td][td]
5​
[/td][td][/td][td][/td][td][/td][td][/td][/tr]

[tr][td="bgcolor: #DCE6F1"]
8
[/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][td][/td][/tr]
[/table]


Formula in J2
=SUMIF(B$1:F$1,I2,INDEX(B$2:F$7,MATCH(H2,A$2:A$7,0),0))

M.
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,178
Members
452,615
Latest member
bogeys2birdies

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