Summing not summing

D

doofy

I've got a worksheet, and it references values in a second worksheet.
The values are transposed (via cell formula from the second worksheet)
onto the first worksheet.

When the cell formula is: ='sql link'!u3

The values from the second worksheet show up fine. So I have a column
of these:

='sql link'!u3
='sql link'!v3
='sql link'!w3
='sql link'!x3
='sql link'!y3

at the bottom I have a formula that sums those values:

=sum(d2:d6)

I get zero in that field, though the total of the values above do not
equal zero.

If I tried a test cell below the sum field:

=d2

and it correctly picks up the value of the field from the column above.
The sum field should work. Why isn't it?
 
B

Bob Phillips

Try this array formula

=SUM(--D2:D6)

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
B

Bob Phillips

Mine was an array formula, so enter with Ctrl-Shift-Enter, not just enter.

It is text, that is why SUM is failing.

--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
T

Toppers

If fields are text .....

=SUM(d2:d6) will give 0 but =d2+d3+d4+d5+d6 will give correct result!
 
D

doofy

Toppers said:
If fields are text .....

=SUM(d2:d6) will give 0 but =d2+d3+d4+d5+d6 will give correct result!

except its int's coming out of SQL Server, which is where I'm getting
the data from to fill the second worksheet.
 
D

doofy

b&s said:
Another approach...if fields are text .....

=SUMPRODUCT(--D2:D6)

how do I make the fields NOT text? They are coming from a sqlsvr table
and into the second worksheet as int's. Is it just as simple as
formatting the cells of the first worksheet as number rather than general?
 
D

Dave Peterson

Changing the number format doesn't change the value in the cell.

I like this technique.
select an empty cell
edit|copy
select the range to fix
edit|paste special|click Add
 
H

Harlan Grove

Bob Phillips said:
Try this array formula

=SUM(--D2:D6)
....

Should have used

=SUMPRODUCT(--D2:D6)

but if these values would be used in other calculations, probably better to
make each of them numbers, so

=--'sql link'!u3
=--'sql link'!v3
etc.
 
H

Harlan Grove

Bob Phillips said:
No I shouldn't, array SUM works.

True, but I meant in the sense of avoiding unnecessary follow-up and
responses when the OP failed to enter your SUM formula as an array formula.
Care to check the frequency of OPs failing to catch the 'array formula'
caveats in responses they receive?

'Course if you like the unnecessary addition back & forth . . .
 
B

Bob Phillips

Harlan Grove said:
True, but I meant in the sense of avoiding unnecessary follow-up and
responses when the OP failed to enter your SUM formula as an array
formula. Care to check the frequency of OPs failing to catch the 'array
formula' caveats in responses they receive?

'Course if you like the unnecessary addition back & forth . . .


Almost as much as your good self <bg>
 

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