Advanced SUMPRODUCT question

apiekar

New Member
Joined
Jan 17, 2017
Messages
1
I have historically used SUMPRODUCT as a way to manipulate arrays to provide certain data in sort of an advanced vlookup type of fashion. For instance I would do something like =sumproduct((A1:A5="xyz")*(B1:B5="ABC")*(C1:C5)).

Behind the scenes, excel's calculations would end up being something like =sumproduct({0;0;1;0;1}*{0;0;0;0;1}*{1;2;3;4;5}), with the resulting being '5'.

What I am trying to do now, is create something that depending on a certain condition, it produces a particular formula, sort of like an advanced IF statement.

For instance, something like

=sumproduct((A1:A3="XYZ")*(if(x>y,0);if(x=y,1);if(x < y,2))
<y,2))

However, this formula generates an error, it doesn't work.

Any help would be much appreciated

Thanks.</y,2))
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

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