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.
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
Works brilliant, will try filter method,
I did change the Boolean part to a double negative rather than multiplication, I've just always --( ,
also, in the xlookup I've not used an array as the lookup value so will have to look into that a bit more. One last thing, ( office 365) , if you use ctrl. shft enter on an array this now stops the spill and just gives the 1st result in a single cell which can be useful.