# Dynamic formula for summing multiple rows and columns

#### atlanticdam

##### New Member
Hello forum, I'm trying to figure out a dynamic formula that will sum all A that is between 1/2019 and 12/2021. Answer should be 220. Would appreciate any pointers.
 Type Dec-19 Sep-20 Jun-21 Mar-22 Dec-22 Jun-23 Jun-24 Jun-25 A 73 35 A 38 74 B 74 56 B 44 8 B 36 45 B 24 B 33 C 51 C 1 52 52 C 32 C 22 D 25 25 25 25

<tbody>
</tbody>

### Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

##### MrExcel MVP
Control+shift+enter, not just enter:

=SUM(IF(\$B\$1:\$I\$1>=K2,IF(\$B\$1:\$I\$1<=K3,IF(\$A\$2:\$A\$13=K1,\$B\$2:\$I\$13))))

where K2 is 1/2019, K3 12/2021, and K1 A.

#### atlanticdam

##### New Member
I don't fully understand how the arguments, but it worked like a charm, thanks.

Would it be possible to construct a formula using "Sumif" or "Sumifs"?

##### MrExcel MVP
I don't fully understand how the arguments, but it worked like a charm, thanks.

You are welcome. It's an array-processing formula.

Would it be possible to construct a formula using "Sumif" or "Sumifs"?

No. The data you have requires array-processing. That is,

either, confirmed with control+shift+enter...

=SUM(IF(\$B\$1:\$I\$1>=K2,IF(\$B\$1:\$I\$1<=K3,IF(\$A\$2:\$A\$13=K1,\$B\$2:\$I\$13))))

or, confirmed with enter...

=SUMPRODUCT(\$B\$2:\$I\$13,(\$B\$1:\$I\$1>=K2)*(\$B\$1:\$I\$1<=K3)*(\$A\$2:\$A\$13=K1))

Replies
2
Views
337
Replies
2
Views
89
Replies
10
Views
206
Replies
1
Views
162
Replies
1
Views
98

1,136,339
Messages
5,675,199
Members
419,553
Latest member
hanahass

### 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.

### Which adblocker are you using?

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

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