Search code examples
excelexcel-formulaformula

Formula will directly Match the Values Then paste Result


I have created a formula by using helping column in Sheet1 and Sheet2 to Paste the Result in Sheet3.

I have Country and IDs in Sheet1 and in Sheet2 Amount and ID.

and in Sheet3 I have Unique Countries so i want to match Sheet2 IDs by Sheet1 to know the Country Name. When Country Name matches then Sum the Amount in Sheet3.

the formulas i have been using are mentioned below. But all i want is to get the result directly without any helping Columns.

any help will be highly appreciated.

=VLOOKUP(J2,Sheet1!$I$2:$J$26,2,0)
=SUMIFS(Sheet2!$E$2:$E$26,Sheet2!$A$2:$A$26,A2)

Below is attached sheet where i have done this calculation.

Linked Sheet


Solution

  • use SUMPRODUCT with a SUMIFS:

    =SUMPRODUCT(SUMIFS(Sheet2!E:E,Sheet2!J:J,Sheet1!I2:I26)*(Sheet1!D2:D26=A2))
    

    enter image description here