Technology Get the latest on technology, electronics and software…

Excel table formula help

Thread Tools
 
Old 01-11-2011 | 03:47 AM
  #1  
mastertl's Avatar
Thread Starter
I don't have a Ferrari in
 
Joined: May 2004
Posts: 3,437
Likes: 2
From: Southern California
Excel table formula help

C7p6w.jpg

I'm trying to get the Cumulative Column to run a continuous total and I'm able to get it to work assuming there are no blank rows. As soon as there is a blank row, the formula goes to shits. I'd like both the Total and Cumulative column to return null cells if there are no numbers, but if there is a completely empty row, is there a way to make the Cumulative column search vertically in the column to continue adding?

My current formulas (I know they are not elegant, I suck...)

For Total: =IF(SUM(C3:E3)>0,SUM(C3:E3),"") [This would be for Cell F3]

For Cumulative: =IF(F3="","",IF(F3>0,(F3+G2),)) [This would be for Cell G3]

If I skip a line, I get the #VALUE! error. Any ideas?
Old 01-11-2011 | 06:32 AM
  #2  
rza49311's Avatar
Drifting
iTrader: (1)
 
Joined: Feb 2006
Posts: 3,072
Likes: 8
From: Southern VA
sounds like you need to nest that inside an IF with an IsError test.
Old 01-11-2011 | 08:32 AM
  #3  
te3point5's Avatar
Drifting
 
Joined: Sep 2004
Posts: 3,474
Likes: 113
From: Seattle, WA
Why don't you do:

in Cell G2: =sum($F$2:F2)

Then drag down
Old 01-11-2011 | 08:38 AM
  #4  
svtmike's Avatar
Team Owner
 
Joined: Oct 2003
Posts: 37,670
Likes: 3,866
From: Chicago
Originally Posted by mastertl
For Total: =IF(SUM(C3:E3)>0,SUM(C3:E3),"") [This would be for Cell F3]

For Cumulative: =IF(F3="","",IF(F3>0,(F3+G2),)) [This would be for Cell G3]

If I skip a line, I get the #VALUE! error. Any ideas?
The "" are what is causing you trouble.

Get rid of them and replace them with these simple formulas:

Total: =SUM(C2:E2) and fill down

Cumulative: =SUM(F$2:F2) and fill down

Go to Excel Options->Advanced, under the "Display Options for this Worksheet", uncheck "Show a zero in cells that have zero value".
Old 01-11-2011 | 12:08 PM
  #5  
Bearcat94's Avatar
AZ Community Team
 
Joined: May 2007
Posts: 32,488
Likes: 7,771
From: N35°03'16.75", W 080°51'0.9"
What they said.

Think of this way: If you have a blank row, the value for that day is "0". Your cumulative amount, including that day, is the previous cumulative amount + 0.

IOW - just let the cumulative amount tally on those blank rows.
Old 01-11-2011 | 11:14 PM
  #6  
1Louder's Avatar
Old Man Yelling at Clouds
 
Joined: Apr 2007
Posts: 16,973
Likes: 7,362
From: Seattle, WA
What they said too.

I think the #Value is coming from not setting a value if F3<=0:

IF(F3="","",IF(F3>0,(F3+G2),))

Because you are triggering that condition, which is leaving some null value in G6 and then you're trying to add it in G7. If you did this:

IF(F3="","",IF(F3>0,(F3+G2),0))

It would work, but you'd have a zero in the cell.
Old 01-11-2011 | 11:21 PM
  #7  
svtmike's Avatar
Team Owner
 
Joined: Oct 2003
Posts: 37,670
Likes: 3,866
From: Chicago
Originally Posted by 1Louder
What they said too.

I think the #Value is coming from not setting a value if F3<=0:

IF(F3="","",IF(F3>0,(F3+G2),))

Because you are triggering that condition, which is leaving some null value in G6 and then you're trying to add it in G7. If you did this:

IF(F3="","",IF(F3>0,(F3+G2),0))

It would work, but you'd have a zero in the cell.
What's happening is the "" used as the result of the IF() functions is setting up a string value in some of the cells, which the SUM() function doesn't handle -- it throws a #VALUE error instead.

I just went through an extensive redesign of a large spreadsheet to eliminate this very problem.
Old 01-12-2011 | 03:31 AM
  #8  
mastertl's Avatar
Thread Starter
I don't have a Ferrari in
 
Joined: May 2004
Posts: 3,437
Likes: 2
From: Southern California
The SUM formula worked perfectly. I think I was thinking too hard about how to make the table work. Its much simpler than what I originally had in mind.

I ended up using this in G2 and dragged down.

=IF(F2="","",SUM($F$2:F2))

The problem with unchecking the show zeroes option is that I'm not sure if it would show up when I send the spreadsheet out.

Y'all are some Excel pros
Old 01-12-2011 | 08:39 AM
  #9  
svtmike's Avatar
Team Owner
 
Joined: Oct 2003
Posts: 37,670
Likes: 3,866
From: Chicago
Originally Posted by mastertl
The problem with unchecking the show zeroes option is that I'm not sure if it would show up when I send the spreadsheet out.
That setting will stay with the spreadsheet, so it will work when you send it out.
Old 01-12-2011 | 01:52 PM
  #10  
1Louder's Avatar
Old Man Yelling at Clouds
 
Joined: Apr 2007
Posts: 16,973
Likes: 7,362
From: Seattle, WA
Originally Posted by mastertl
The SUM formula worked perfectly. I think I was thinking too hard about how to make the table work. Its much simpler than what I originally had in mind.

I ended up using this in G2 and dragged down.

=IF(F2="","",SUM($F$2:F2))

The problem with unchecking the show zeroes option is that I'm not sure if it would show up when I send the spreadsheet out.

Y'all are some Excel pros
Another alternative to "show zeros" - If you ever want to get around that (or having to put strings in your cells), but don't want zeros showing up, what you can do is have your IF statements populate cells with a zero (or make it some bizarre number that would never happen, like -9999). And then set conditional formatting on the cell to turn the font white when the cell equals that value. It's not too much work and it's a good way to make unwanted place-holder data "disappear" on print outs.
Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
knight rider
Car Talk
9
03-04-2016 09:59 AM
08_UA7_Gr33k
Member Cars for Sale
13
02-11-2016 03:17 PM
InFaMouSLink
Non-Automotive & Motorcycle Sales
2
11-11-2015 01:19 PM
InFaMouSLink
Car Parts for Sale
6
10-27-2015 07:52 PM
08_UA7_Gr33k
Member Cars for Sale
1
09-27-2015 02:56 PM




All times are GMT -5. The time now is 04:27 PM.