Combining Xlookup and Sumif

%3CLINGO-SUB%20id%3D%22lingo-sub-2689017%22%20slang%3D%22en-US%22%3ECombining%20Xlookup%20and%20Sumif%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2689017%22%20slang%3D%22en-US%22%3E%3CP%3EHello!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIm%20currently%20trying%20to%20combine%20the%20use%20of%20xlookup%20and%20sumif%20for%20below%20sheet.%3C%2FP%3E%3CP%3EI%20thought%20of%20using%20sumif%20on%20the%20return%20array%20section%20of%20xlookup%20but%20I%20keep%20getting%20%23value!%20error.%3C%2FP%3E%3CP%3Ei%20just%20need%20to%20print%20the%20sum%20of%20cost%20for%20an%20id%20if%20it%20is%20found.%20I%20need%20it%20to%20be%20in%20conjunction%20with%20xlookup%20as%20it%20will%20then%20be%20added%20to%20a%20larger%20formula.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Ccrossed_0-1629998494736.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F306064i223BE41FEC3400DF%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Ccrossed_0-1629998494736.png%22%20alt%3D%22Ccrossed_0-1629998494736.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2689017%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2689042%22%20slang%3D%22en-US%22%3ERe%3A%20Combining%20Xlookup%20and%20Sumif%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2689042%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1128056%22%20target%3D%22_blank%22%3E%40Ccrossed%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20XLOOKUP()%20return_array%20shall%20be%20an%20array%20of%20the%20same%20size%20as%20lookup_array%2C%20not%20scalar%20value%20which%20is%20returned%20by%20SUMIF().%20Not%20sure%20what%20%22larger%20formula%22%20shall%20do%20but%20you%20need%20another%20combination.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello!

 

Im currently trying to combine the use of xlookup and sumif for below sheet.

I thought of using sumif on the return array section of xlookup but I keep getting #value! error.

i just need to print the sum of cost for an id if it is found. I need it to be in conjunction with xlookup as it will then be added to a larger formula.

 

Ccrossed_0-1629998494736.png

 

1 Reply

@Ccrossed 

With XLOOKUP() return_array shall be an array of the same size as lookup_array, not scalar value which is returned by SUMIF(). Not sure what "larger formula" shall do but you need another combination.