Dynamic SumIfs Formula - Having issues with the Generally Accepted Approach

jake1997harrison

New Member
Joined
Jan 20, 2023
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am attempting to use the standard sumproduct/subtotal/offset approach to dynamically sum a range based on given criteria. The criteria are the model an account is invested in and the target value of equity. All data is contained in a table and I’d prefer to use table references if possible so as to make the macro that writes this formula cleaner.

Here is my current formula using standard range references that returns the dreaded #N/A error. Help cleaning up my syntax or ideas for diagnosing the error would be much appreciated.

=SUMPRODUCT(SUBTOTAL(109,OFFSET(J41,ROW(J41:J349)-ROW(J41),)),—(AF41:AF349=“PIM 1”),—(P41:P349=80))
*due to the sensitive nature of the data in the spreadsheet and a corporate firewall, I cannot post the actual spreadsheet or screenshots of the spreadsheet.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Try this

=SUMPRODUCT(SUBTOTAL(109,OFFSET(J41,ROW(J41:J349)-ROW(J41),)),—((AF41:AF349=“PIM 1”)*(P41:P349=80)))

Are you able to post some dummy data?
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,399
Members
448,957
Latest member
Hat4Life

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