Convert Range into Set for CSE use

Trojan35

New Member
Hi, I need to do this formula:

=SUM(IF((A1:A100={1,59,303}), B1:B100, 0))

but I need to use cells D1:D3 instead of {1,59,303}. I know i could make one long formula but given that i'll need to use different ranges (say, F3:F37) for many different formulas, that is not practical.

Thanks.

Excel Facts

To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Brian from Maui

MrExcel MVP
Trojan35 said:
Hi, I need to do this formula:

=SUM(IF((A1:A100={1,59,303}), B1:B100, 0))

but I need to use cells D1:D3 instead of {1,59,303}. I know i could make one long formula but given that i'll need to use different ranges (say, F3:F37) for many different formulas, that is not practical.

Thanks.

Maybe this will help,

=SUMPRODUCT(--(ISNUMBER(MATCH(A1:A10,F1:F3,0))),B1:B10)

Trojan35

New Member
Wow that's awesome. Thanks. What does the -- do?

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

1,164,546
Messages
5,838,011
Members
430,526
Latest member
NiceGuyWithExcel2007

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.

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

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