Dynamic SUMIFS

daveyc18

Well-known Member
Joined
Feb 11, 2013
Messages
790
Office Version
  1. 365
  2. 2010
=SUMIF($K$5:$K$111,"*C",L$5:L$111)*100+SUMIF($K$5:$K$111,"*S",L$5:L$111)-SUMIF($K$5:$K$111,"*P",L$5:L$111)*200


sometimes more rows of data are added so i need to adjust L111 to , say L130
 
You can make your range an Excel Table,rebuild your formula based on the table. Any row added/deleted will extend/shorten the range automatically.
 
Upvote 0
sometimes more rows of data are added so i need to adjust L111 to , say L130
Besides using a formal table (probably the better option) - is there a reason why you can't just specify a sufficiently large range, say a 1000 rows?

FWIW, you can also write your formula a little more succinctly, like this.

Excel Formula:
=SUMPRODUCT(SUMIF($K$5:$K$1000,{"*C","*S","*P"},L$5:L$1000),{100,1,-200})
 
Upvote 0
Besides using a formal table (probably the better option) - is there a reason why you can't just specify a sufficiently large range, say a 1000 rows?

FWIW, you can also write your formula a little more succinctly, like this.

Excel Formula:
=SUMPRODUCT(SUMIF($K$5:$K$1000,{"*C","*S","*P"},L$5:L$1000),{100,1,-200})

i don't want to make too many extra rows and like to keep it tight
 
Upvote 0
I agree that a table is the way to go, but there's no real impact to performance with that formula using extra rows, or even full column references.
 
Upvote 0

Forum statistics

Threads
1,226,876
Messages
6,193,460
Members
453,801
Latest member
777nycole

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