Sum Function

happyhungarian

Active Member
Joined
Jul 19, 2011
Messages
252
Office Version
  1. 365
Platform
  1. Windows
Hi,

Not sure if this is possible but I need to create a dynamic sum function where the final row being summed is determined by when the function runs into a blank cell. For Example, if in cell A1 I have the following function =sum(A2:A10) and I have data points in cells A2:A10... but then my data set changes and now my data points only reside in A2:A6 I want the sum function to then only look at A2:A6 (because A7 is blank). I know it doesn't make sense why I need this and I should just sum all of Column A but then the function would capture additional data that I don't want it to. Is there a way to do this WITHOUT macros/VBA?

Thank you,

Jesse
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Hi,

Try this array formula:

Code:
=SUM(A2:INDEX(A2:A100,MATCH(TRUE,A2:A100="",0)-1))

Which needs committing with CTRL+SHIFT+ENTER.

Matty
 
Upvote 0
Also:

=SUM(OFFSET(A2,,,MATCH(TRUE,A2:A100="",0)))

Confirm with CTRL-SHIFT-ENTER rather than just Enter.
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,828
Members
452,946
Latest member
JoseDavid

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