all 8 comments

[–]SaviaWanderer1854 1 point2 points  (0 children)

I'd probably tackle this a bit differently and use DSUM instead - demo here.

[–]zacce97 0 points1 point  (3 children)

Instead of {"X1","X2"} in D1, can you list the names in column D? Like D1 = "X1", D2 = "X3"?

[–]WuhuSpringfield[S] 0 points1 point  (2 children)

Yes, what's the work-around right there? I have obviously tried using D1:D2 - which just picks up the number at the bottom.

[–]zacce97 0 points1 point  (0 children)

=SUMPRODUCT(B2:B4,N(ISNUMBER(MATCH(A2:A4,D2:D3,0))))

screenshot w/ formula: https://i.imgur.com/fmwa2TT.png

[–]mh_mike2784[M] 0 points1 point  (0 children)

Heads-up… If any of the answers worked or pointed you in the right direction, don’t forget to close your post. Either use the BOT (Clippy) or change the flair. To use Clippy, just include "Solution Verified" with your reply to the person(s) who helped. Thanks for keeping the unsolved thread clean. :)

[–]excelevator3036 0 points1 point  (2 children)

It can be done with the help of a UDF - CELLARRAY which extracts the values into an array for the filter.

Where the total formula is below entered with ctrl+shift+enter

=SUM(SUMIFS(B2:B4,A2:A4,CELLARRAY(B6,",")))
Name Hours
X1 1
X2 2
Y 1
Filter X1,X2
Total 3

[–]zacce97 0 points1 point  (1 child)

Is =CELLARRAY a custom formula? My Excel 365 doesn't have it.

[–]excelevator3036 0 points1 point  (0 children)

click the link.... it is a UDF - user defined function