SOLVED

Sumproduct with Indirect

%3CLINGO-SUB%20id%3D%22lingo-sub-2029886%22%20slang%3D%22en-US%22%3ESumproduct%20with%20Indirect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029886%22%20slang%3D%22en-US%22%3EHello%20Friends%2C%3CBR%20%2F%3EI%20have%20two%20excel%20file%2C%20the%20detail%20file%20is%20having%20monthwise%20sheet%20where%20department%20wise%20excpenses%20is%20given%20for%20budget%2C%20rolling%20plan%20and%20actual%20period.%3CBR%20%2F%3EIn%20summary%20want%20to%20fetch%20monthwise%20data%20from%20detail%20file%2C%20to%20change%20the%20month%20want%20to%20use%20the%20indirect%20function%20rather%20than%20changing%20month%20by%20Ctrl%2BH.%3CBR%20%2F%3EPlease%20Help.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20and%20Regards%2C%3CBR%20%2F%3ESubhasis.%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2029886%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-2030164%22%20slang%3D%22en-US%22%3ERe%3A%20Sumproduct%20with%20Indirect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2030164%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F767899%22%20target%3D%22_blank%22%3E%40SubhasisB%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20your%20case%20that%20could%20be%20like%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DSUMPRODUCT(%0A%20%20(INDIRECT(%22'%5BDetails.xlsx%5D%22%26amp%3BSUBSTITUTE(C%242%2C%22'%22%2C%22''%22)%26amp%3B%22'!%24B%242%3A%24B%2413%22)%3D%24B3)*%0A%20%20(INDIRECT(%22'%5BDetails.xlsx%5D%22%26amp%3BSUBSTITUTE(C%242%2C%22'%22%2C%22''%22)%26amp%3B%22'!%24C%241%3A%24E%241%22)%3DC%241)*%0A%20%20(INDIRECT(%22'%5BDetails.xlsx%5D%22%26amp%3BSUBSTITUTE(C%242%2C%22'%22%2C%22''%22)%26amp%3B%22'!%24C%242%3A%24E%2413%22))%0A)%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EPlease%20not%2C%20INDIRECT()%20doesn't%20work%20with%20closed%20file%2C%20thus%20full%20path%20is%20not%20required%20-%20you%20shall%20to%20keep%20Details%20opened.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2043339%22%20slang%3D%22en-US%22%3ERe%3A%20Sumproduct%20with%20Indirect%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2043339%22%20slang%3D%22en-US%22%3EThank%20You%20very%20much%20for%20the%20reply.%3C%2FLINGO-BODY%3E
Occasional Contributor
Hello Friends,
I have two excel file, the detail file is having monthwise sheet where department wise excpenses is given for budget, rolling plan and actual period.
In summary want to fetch monthwise data from detail file, to change the month want to use the indirect function rather than changing month by Ctrl+H.
Please Help.

Thanks and Regards,
Subhasis.
3 Replies
Best Response confirmed by SubhasisB (Occasional Contributor)
Solution

@SubhasisB 

In your case that could be like

=SUMPRODUCT(
  (INDIRECT("'[Details.xlsx]"&SUBSTITUTE(C$2,"'","''")&"'!$B$2:$B$13")=$B3)*
  (INDIRECT("'[Details.xlsx]"&SUBSTITUTE(C$2,"'","''")&"'!$C$1:$E$1")=C$1)*
  (INDIRECT("'[Details.xlsx]"&SUBSTITUTE(C$2,"'","''")&"'!$C$2:$E$13"))
)

Please not, INDIRECT() doesn't work with closed file, thus full path is not required - you shall to keep Details opened.

Thank You very much for the reply.

@SubhasisB , you are welcome