Change a sumif formula to be more dynamic

CaptainGravyBum

Board Regular
Joined
Dec 1, 2023
Messages
70
Office Version
  1. 365
Platform
  1. Windows
Hello,
I have a formula that is working very well, but it has a unique row number specified. If I try to drag it past the set number of rows the formula errors.
How can I make it more dynamic?, sorry for just pasting the formula, but hopefully you can get anything you need from it without the worksheet as well.
I did try changing the $B$3:$B$25 type ranges to be B:B, but that doesn't work.

=IF(COUNTIFS($B$3:$B$25,B4,$D$3:$D$25,D4)=COUNTIFS($B$3:$B4,B4,$D$3:$D4,D4), SUMPRODUCT(($B$3:$B$25=$B4)*($D$3:$D$25=$D4)*($R$3:$R$25)),"")
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Maybe
Excel Formula:
=IF(COUNTIFS(B:B,B4,D:D,D4)=COUNTIFS($B$3:$B4,B4,$D$3:$D4,D4), SUMIFS(R:R,B:B,B4,D:D,D4),"")
 
Upvote 2
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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