Forum Discussion
index match multiple sheets and then sum the value
- 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!
=SUM(IFERROR(FILTER(UEPL_Final!$N$6:$N$200, UEPL_Final!$E$6:$E$200 = $C11,LEPL_Final!$N$6:$N$200, LEPL_Final!$E$6:$E$200 = $C11,IMN_Final!$N$6:$N$200, IMN_Final!$E$6:$E$200 = $C11), 0))
when I use this it gives me prompt "too many arguments"
Can you please help me resolve/fix this logic?
Thanks!
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!
- dartmangtSep 24, 2024Copper Contributor
I have a simple question....
I have 54 sheets with identical headers on each sheet............now I need those sheets add up to the front sheet
- SergeiBaklanSep 24, 2024MVP
- AKuma0411Dec 07, 2023Brass Contributorthis is super awesome and worked perfectly for my requirement! thanks!