Forum Discussion
John_Bloggsajohnso9
Jul 03, 2024Copper Contributor
What is wrong with the following equation?
I can't get the following formula to work =FORECAST.LINEAR(L20,{XLOOKUP(L20,B26:B30,B26:B30,,-1),XLOOKUP(L20,B26:B30,B26:B30,,1)},{XLOOKUP(L20,B26:B30,D26:D30,,-1),XLOOKUP(L20,B26:B30,D26:D30,...
djclements
Jul 04, 2024Bronze Contributor
John_Bloggsajohnso9 You cannot place formulas inside of curly brackets { } to generate an array of results. Use either HSTACK or VSTACK instead:
=FORECAST.LINEAR(L20,
HSTACK(XLOOKUP(L20,B26:B30,B26:B30,,-1), XLOOKUP(L20,B26:B30,B26:B30,,1)),
HSTACK(XLOOKUP(L20,B26:B30,D26:D30,,-1), XLOOKUP(L20,B26:B30,D26:D30,,1))
)
If HSTACK and VSTACK are not available in your version of Excel, output the results of each XLOOKUP formula to their own cells and reference the corresponding ranges for the known_ys and known_xs results.
- John_Bloggsajohnso9Jul 04, 2024Copper ContributorThanks DJ Clements. I thought it might have something to do with the curly brackets.