Using SumIF worksheet function to the end of the column

Imagoodwon

New Member
Joined
Jan 14, 2010
Messages
17
How can I rewrite this SumIF =SUMIF(A$2:A$1760,AY2,U$2:U$1760)
so that the A$1760 & U$2:U$1760 is NOT hard coded, but sets the range from A2 to the last used cell in Column A and Column U.

Thanks.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Yes, but which cell? If it's at the bottom of the list, it may be included in the SUMIF, creating a circular reference.
 
Upvote 0
I have a Dynamic Named Range called Total_Expenses

=OFFSET(Vendors!$D$2,0,0,COUNTA(Vendors!$D:$D),1)


In Column E2 I want to have a Total of that range minus the last used value,
because the worksheet was set up with SUM hard coded to add up those values in Column D.
If I use =SUM(Total_Expenses) it would include the whole selection, including the total already added in.


What I need is the equivalent of End(xlUp).Offset(-1, 0) that goes on a worksheet.


The SUM function goes in E2
The SUMIF function goes in Y2

Thanks

Yes, but which cell? If it's at the bottom of the list, it may be included in the SUMIF, creating a circular reference.
 
Upvote 0
Yup! THANKS !

Didn't think of that.
But for future reference, is there a formula that can go on the worksheet which functions like Lastrow .End(xlUp)

I know you can do this using VBA in a module, but I'm thinking of something with the same functionality , and used directly on a worksheet.

Can't you just divide the SUM by 2? Including the total line shouldn't matter to SUMIF.
 
Upvote 0
To return a reference to the last numeric cell in column A:

=INDEX(A:A,MATCH(9.99999999999999E+307,A:A))

To use that reference to sum from A2 to that cell:

=SUM(A2:INDEX(A:A,MATCH(9.99999999999999E+307,A:A)))
 
Upvote 0

Forum statistics

Threads
1,215,134
Messages
6,123,237
Members
449,093
Latest member
Vincent Khandagale

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