Hi,
In cell L4, enter this formula and drag down
=SUM(FILTER($H$4:$H$16,$G$4:$G$16=J4,0)*K4)
Hope this helps.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I'd like to multiply different sized array based on a condition, I've made some attempts using switch,
SUMPRODUCT(SWITCH(Table1[Item],"a",2,"b",3,"c",5,"d",6),Table1[Sales])
But this is not ideal and also I'd like to get the result for each Item, a b c and d .
I'm looking to get a total for each item, I was thinking if I could wrap the above in a IF statement,
IF( X ="a" , Sumproduct, if = "b" etc. , but the formula would still be returning the full amount.
The closest I've got so far is but the array { litems} doesn't seem to work, thought it might, so works fine for each 'a' but then I still need to sum the group?
IF(G4= {"a","b","c","d"},H4*SWITCH(G4,"a",2,"c",5,"b",3,"d",6))
could do with some fresh ideas.
Richard
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Filter works as well, thanks, for the help, I do like the sumproduct version, just because it's alway been my favorite function, which I've overlooked as spend most of my time trying to do stuff with P query and pivot.
Just to add about ctrs shift enter in 365, it can be useful when entering array formulas like the xlookup part used here into a Table, it stops the spill error.
Richard.
You are welcome.