Subtract then Add Results

L

LinZ

I need to subract column G from column F and then add the results. There are
16 rows that this needs to be done for. I need a formula to enter to get it
to do this without have a ton of helper cells. I tried =sum(F2:F17-G2:G17)
 
T

T. Valko

Try this:

=SUMPRODUCT(F2:F17-G2:G17)

Your formula will work if you enter it as an array.

=SUM(F2:F17-G2:G17)

Array formulas are entered differently than a regular formula. After you
type in a regular formula you hit the ENTER key. With an array formula you
*must* use a combination of keys. Those keys are the CTRL key, the SHIFT key
and the ENTER key. That is, hold down both the CTRL key and the SHIFT key
then hit the ENTER key.

When done properly Excel will enclose the formula in squiggly brackets { }.
You can't just type these brackets in, you *must* use the key combo. Also,
anytime you edit an array formula it *must* be re-entered as an array using
the key combo.
 
R

Rick Rothstein

What you have would have worked if you array-entered it. To do that, commit the formula with Ctrl+Shift+Enter, not just Enter by itself. If you don't want to have to remember that in the future, you can use this normally-entered formula instead...

=SUMPRODUCT(F2:F17-G2:G17)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top