View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Spiky Spiky is offline
external usenet poster
 
Posts: 622
Default Can you subtotal data in rows?

On Aug 25, 2:14 pm, Duke Carey
wrote:
If you look up the SUBTOTAL() function in Help you'll find that you can
perform a number of calculations - not just 'sums' and depending on the
parameter value you supply, Excel will disregard hidden cells.


Still doesn't work horizontally, though. Unless that changed in Excel
2007.

This works. Couple of issues with it. It includes a UDF from morefunc,
available online for free. And it doesn't calculate automatically for
hiding/unhiding columns, you would have to press F9 to check. It does
calculate automatically if you actually change a number in a cell.

=SUMPRODUCT(B1:E1,--(XLM.GET.CELL(53,B1:E1)<""))

This also works. The CELL function should also be able to do this, but
it can only handle one cell at a time, no arrays. So you have to add
each cell individually, killing the neat SUM function that has existed
for some time. That might be a serious pain after a while. But it
doesn't need a download of 3rd party software, or you to write your
own UDF. Note that this also would not auto-calculate, must press F9.
=SUM(IF(CELL("width",B1)=0,0,B1),IF(CELL("width",C 1)=0,0,C1),IF(CELL("width",D1)=0,0,D1),IF(CELL("wi dth",E1)=0,0,E1))