problem with sum function

enxocoebl

Board Regular
Joined
Oct 24, 2011
Messages
54
hey
i have this tiny little problem. i have no idea why this is happening and what i can do to make it alright.
formula in j4 to j20 is =IF(P2="",J4,H1+I1)...( as i go down to j5.. P2 becomes P3 and j4 becomes j5 and so on)
now in cell j21 i have a sum function (=SUM(J4:J20))
sum function does not work.. it remains zero all the time
i selected (J4:J20) in the formula bar and hit F9. this is what i got.
{45;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0}
even when the first cell is 45 the sum cell (j21) shows 0.
how can i make it work.
thank you.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Are there any "" in j4:j20? It might be reading it as "text" and not summing the column as a result.
 
Upvote 0
No blanks in the cells between j4 and j20
j4 has 45 (as a result of the addition of 44 and 1 in cells h1 and i1). the rest are 0's
 
Upvote 0
It's because your formulas in the J column have circular references (they refer to themselves).
eg. In J4 your formula is

=IF(P2="",J4,H1+I1)


Perhaps you want this instead?

=IF(P2="",0,H1+I1)
 
Upvote 0
If possible, try to enter the same formulas in a different area of the workbook. If it works in the new area, delete the columns where the current formulas are, and reenter them. Hopefully, this doesn't cause too much trouble.
 
Upvote 0
pplstuff you maybe right. i tried entering values in all the cells and it worked. cell j21 showed the sum of j4:j20
colin legg: i need that because i want it to show the last value in the cell before it is updated.

when all the cells in column P (P2,P3,P4...) are not empty then i get the sum.
 
Upvote 0
but i want it to calculate the sum as i fill in the values.. like how SUM function is supposed to work.
also please tell me what i can do if there are "" in between.
 
Upvote 0

Forum statistics

Threads
1,215,375
Messages
6,124,589
Members
449,174
Latest member
chandan4057

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top