# Need Help with a formula

Hello

the sum-product formula  needs one improvement, currently  it operates with the use of two helper columns. i want to the formula to be improved so that it operates without the need of helper columns or if there is any better way to achieve getting the same result .

thanks.
EE.xlsx
LVL 27
###### Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Why do you think it will be better to not use the helper columns? In all likelihood it will simply require an extremely complicated formula that will be much harder to understand and maintain, and probably perform worse.
0
Author Commented:
Thank you Rory for your comment.

I would also prefer using helper columns, but in the worksheet that is heavily populated with formulas, i have no visible range space to keep the helper columns. i was thinking, whether it would be possible or not. i tried it myself but messed it up when combined them together.

if it would not be possible then i would have no option but to continue with the same structure.

thanks.
0
Commented:
If you insist - in N2:

=SUMPRODUCT(--(SUM(M\$2:M2)>SUBTOTAL(109,OFFSET(\$C\$1,0,0,ROW(\$C\$1:\$C\$2)-MIN(ROW(\$C\$1:\$C\$2))+1))),SUM(M\$2:M2)-SUBTOTAL(109,OFFSET(\$C\$1,0,0,ROW(\$C\$1:\$C\$2)-MIN(ROW(\$C\$1:\$C\$2))+1)),SUBTOTAL(109,OFFSET(\$D\$2,ROW(\$D\$2:\$D\$3)-MIN(ROW(\$D\$2:\$D\$3)),0))-N(OFFSET(\$D\$1,ROW(\$D\$1:\$D\$2)-MIN(ROW(\$D\$1:\$D\$2)),0)))-SUM(N\$1:N1)

and copy down. I'm sure there are more compact formulas!
0

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
Thank you very much Rory.

i changed some of the cell reference from absolute reference to mixed reference and it worked.

i do not think, there would be any other solution but the one you provided. because, my request on one of other forums were pending for months and nobody came up with any solution, except i got the message that it is impossible. so i had to ask the mod to delete the question. but finally here you got it right.  thanks a lot.  i am also a fan of your web excelmatters

=SUMPRODUCT(--(SUM(M\$2:M2)>SUBTOTAL(109,OFFSET(\$C\$1,0,0,ROW(\$C\$1:\$C2)-MIN(ROW(\$C\$1:\$C2))+1))),SUM(M\$2:M2)-SUBTOTAL(109,OFFSET(\$C\$1,0,0,ROW(\$C\$1:\$C2)-MIN(ROW(\$C\$1:\$C2))+1)),SUBTOTAL(109,OFFSET(\$D\$2,ROW(\$D\$2:\$D3)-MIN(ROW(\$D\$2:\$D3)),0))-N(OFFSET(\$D\$1,ROW(\$D\$1:\$D2)-MIN(ROW(\$D\$1:\$D2)),0)))-SUM(N\$1:N1)
0
Author Commented:
you have a great intellect
0
Commented:
Oh so it's you that reads it! :)
0
Author Commented:
:-)
0
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.