Issues with AGGREGATE function

hgalstyan

New Member
Joined
Aug 25, 2016
Messages
4
I am trying to use Aggregate function to sum up the rows in M column, referencing to A column (to the rows, where the cell starts with "O" letter. Here is the formula: =+AGGREGATE(9,2,(A7:A112="O*")*M7:M112).
The result is #VALUE! error. Is there an alternative way to to this? Sumproduct, sum+if, sum(sumif and other formulas do not work, as I need to ignore errors and nested subtotals in M column.

Great thanks to anyone who tries to help.

Regards,
Hrayr
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Are you trying to use the asterisk as a wildcard there, i.e. column A entries should begin with the letter O?

If so, you won't be able to within AGGREGATE. More importantly, you can only use conditional clauses (e.g. (A7:A112="O") within that function if the function_num parameter is 14 or greater.

I would suggest switching to an array formula** with SUBTOTAL:

=SUM(IF(SUBTOTAL(2,OFFSET(M7,ROW(M7:M192)-MIN(ROW(M7:M192)),)),IF(LEFT(A7:A192)="O",M7:M192)),)

which will also ignore nested subtotals and errors within the range M7:M192.

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
 
Upvote 0
Are you trying to use the asterisk as a wildcard there, i.e. column A entries should begin with the letter O?

If so, you won't be able to within AGGREGATE. More importantly, you can only use conditional clauses (e.g. (A7:A112="O") within that function if the function_num parameter is 14 or greater.

I would suggest switching to an array formula** with SUBTOTAL:

=SUM(IF(SUBTOTAL(2,OFFSET(M7,ROW(M7:M192)-MIN(ROW(M7:M192)),)),IF(LEFT(A7:A192)="O",M7:M192)),)

which will also ignore nested subtotals and errors within the range M7:M192.

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).


Thanks for reply, but this array formula returns #N/A
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,399
Members
449,447
Latest member
M V Arun

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