Array Question

  • Thread starter Thread starter David Lipetz
  • Start date Start date
D

David Lipetz

How do you use the SUM function in an array?

For instance, here is array formula that does not work:

=IF($E5:$E398="5N",$K5:$K398,SUM($G5:$J5))

What I need is the array to SUM $G5:$J5 through $G398:$J398

How does one correctly specify this sum range in an array?
 
Do you mean

=SUMPRODUCT(($E5:$E398="5N")*($G5:$J5))


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
I don't think so.

Formula should:

For range E5:E398, if E = "5N" then display value in K else sum values in G
through J.

SUMPRODUCT does not seem to do that.
 
Perhaps this is it

=SUMIF($E5:$E398,"5N",$K5:$K398)+SUMPRODUCT(($E5:$E398<>"5N")*($G5:$J398))


--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 
Presumably you used CTRL-SHIFT-ENTER to commit the formula, rather than
just <enter>? And then copied it down to row 398?

Pete
 
It wasn't an array formula.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)
 

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

Back
Top