Forum Discussion

AKuma0411's avatar
AKuma0411
Brass Contributor
Dec 05, 2023

index match multiple sheets and then sum the value

Hi,   Is there a formula in excel which can lookup for a match in multiple tabs (around 6) and if it finds a match it should return the value summing up the values where a match was found looking f...
  • djclements's avatar
    djclements
    Dec 07, 2023

    AKuma0411 The FILTER function only accepts three arguments. The basic syntax is:

     

    =FILTER(array, include, [if_empty])

     

    To SUM the results from multiple worksheets, try the following:

     

    =SUM(
       FILTER(UEPL_Final!$N$6:$N$200, UEPL_Final!$E$6:$E$200 = $C11, 0),
       FILTER(LEPL_Final!$N$6:$N$200, LEPL_Final!$E$6:$E$200 = $C11, 0),
       FILTER(IMN_Final!$N$6:$N$200, IMN_Final!$E$6:$E$200 = $C11, 0)
    )

     

    If the worksheet tabs are arranged in order from left to right, you could also try using the VSTACK function to reference and filter all three sheets at once. For example:

     

    =SUM(FILTER(VSTACK(UEPL_Final:IMN_Final!$N$6:$N$200), VSTACK(UEPL_Final:IMN_Final!$E$6:$E$200) = $C11, 0))

     

    Or, to improve readability, use the LET function to define the two arrays first:

     

    =LET(
       array1, VSTACK(UEPL_Final:IMN_Final!$N$6:$N$200),
       array2, VSTACK(UEPL_Final:IMN_Final!$E$6:$E$200),
       SUM(FILTER(array1, array2 = $C11, 0))
    )

     

    I hope that helps to clear things up. Cheers!

Resources