dukeofscouts
Board Regular
- Joined
- Jan 19, 2009
- Messages
- 146
I'm combining two formulas that I have intergrated into workbook. I'm cleaning everything up so I would like to have the two formulas calculating in one cell, so this is what I came up with:
=INDEX(Food_Items[Item],SMALL(
IF($AM$3<>"",
IF($C$2<>"",
(--(IFERROR((OFFSET(Foods!$C$2,0,MAX(--('Item Comp'!$E$2:$AK$2<>"")*(COLUMN($E$2:$AK$2)-4)),COUNTA(Food_Items[Item]),1)/
OFFSET(Foods!$C$2,0,MATCH('Item Comp'!$B$1,Table7[[#Headers],[MPGrain]:[Sodium]],0),COUNTA(Food_Items[Item]),1))>(--$AM$3),FALSE())))*(--(Food_Items[Category]=$C$2))*ROW(INDIRECT("1:"&COUNTA(Food_Items[Item]))),
(--(IFERROR((OFFSET(Foods!$C$2,0,MAX(--('Item Comp'!$E$2:$AK$2<>"")*(COLUMN($E$2:$AK$2)-4)),COUNTA(Food_Items[Item]),1)/
OFFSET(Foods!$C$2,0,MATCH('Item Comp'!$B$1,Table7[[#Headers],[MPGrain]:[Sodium]],0),COUNTA(Food_Items[Item]),1))>(--$AM$3),FALSE())))*ROW(INDIRECT("1:"&COUNTA(Food_Items[Item])))),
IF($C$2<>"",(--(Food_Items[Category]=$C$2))*ROW(INDIRECT("1:"&COUNTA(Food_Items[Item]))),ROW(INDIRECT("1:"&COUNTA(Food_Items[Item]))))),ROWS($AN$5:AN5)))
I also did one that was more linear that would put in the applicable arrays and multiply each together. However, in both cases I am having the same issue. When I send the formula down the column, it only returns the first value from the array. I've gone over the syntax several times, and can't find the issue.
Is there a way to fix this, or is this just an impossible formula?
=INDEX(Food_Items[Item],SMALL(
IF($AM$3<>"",
IF($C$2<>"",
(--(IFERROR((OFFSET(Foods!$C$2,0,MAX(--('Item Comp'!$E$2:$AK$2<>"")*(COLUMN($E$2:$AK$2)-4)),COUNTA(Food_Items[Item]),1)/
OFFSET(Foods!$C$2,0,MATCH('Item Comp'!$B$1,Table7[[#Headers],[MPGrain]:[Sodium]],0),COUNTA(Food_Items[Item]),1))>(--$AM$3),FALSE())))*(--(Food_Items[Category]=$C$2))*ROW(INDIRECT("1:"&COUNTA(Food_Items[Item]))),
(--(IFERROR((OFFSET(Foods!$C$2,0,MAX(--('Item Comp'!$E$2:$AK$2<>"")*(COLUMN($E$2:$AK$2)-4)),COUNTA(Food_Items[Item]),1)/
OFFSET(Foods!$C$2,0,MATCH('Item Comp'!$B$1,Table7[[#Headers],[MPGrain]:[Sodium]],0),COUNTA(Food_Items[Item]),1))>(--$AM$3),FALSE())))*ROW(INDIRECT("1:"&COUNTA(Food_Items[Item])))),
IF($C$2<>"",(--(Food_Items[Category]=$C$2))*ROW(INDIRECT("1:"&COUNTA(Food_Items[Item]))),ROW(INDIRECT("1:"&COUNTA(Food_Items[Item]))))),ROWS($AN$5:AN5)))
I also did one that was more linear that would put in the applicable arrays and multiply each together. However, in both cases I am having the same issue. When I send the formula down the column, it only returns the first value from the array. I've gone over the syntax several times, and can't find the issue.
Is there a way to fix this, or is this just an impossible formula?
Last edited: