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))
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

Watch MrExcel Video

Forum statistics

Threads
1,123,316
Messages
5,600,910
Members
414,415
Latest member
joshuaba

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
Top