excel - Trouble using Vlookup in a SUMIFS function statement -
i have accounting spreadsheet trying create analysis area populates 12 month actuals data when enter month, function (in case sumif) update formula based on specific column contains monthly data.
for example:
cell o2 = user input month, example: apr
here data looks like:
product department actuals-apr actuals-may actuals-jun …..
i have lookup table called: “monthactuals” looks follows:
month column jan f feb g mar h apr etc…..
i have hard coded other criteria actual amount, product , department. so, sumifs looks @ hard-coded product , department, needs column month user wants figures.
here formula works correctly without using vlookup ( hard-coded month):
=sumifs(sheet2!$f$8:$f$328,sheet2!$b$8:$b$328," total glass purchases ",sheet2!$c$8:$c$328,"scrap")
here vlookup works correctly:
=vlookup(e1,monthactuals,2,false)
however, when replace “f” column reference in formula vlookup formula, #value error message.
here formula used when tried combine vlookup sumifs.
'sumifs(vlookup(o1,monthactuals,2,false)&”8:”&vlookup(o1,monthactuals,2,false)&“328”,sheet2!$b$8:$b$328,"total glass purchases",sheet2!$c$8:$c$328,"scrap")
i don't want use vba, use functions these calculations.
first careful of ”
not recognized excel, make sure "
next need use indirect()
sumifs(indirect("sheet2!" & vlookup(o1,monthactuals,2,false) & "8:" & vlookup(o1,monthactuals,2,false) & "328"),sheet2!$b$8:$b$328,"total glass purchases",sheet2!$c$8:$c$328,"scrap")
Comments
Post a Comment