View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Arvi Laanemets Arvi Laanemets is offline
external usenet poster
 
Posts: 510
Default SUM to infinity on a column

Hi

When you use an ODBC Query to get access table data into Excel, then in Data
Range Properties you can check 'Fill down formulas...'.
Into cell C1 enter the formula
=IF(ROW()=1,"Sum",SUM(A1,B1))
, and copy down for length of your table (the formuls has to start from 1st
row, otherwise it will be lost whenever query returns no data).

Now, when you requery, and the number of returned rows changes, the range
with formula is automatically synchronized with query data range.


--
Arvi Laanemets
( My real mail address: arvi.laanemets<attarkon.ee )



"Bobby" wrote in message
oups.com...
Hi,
I have a spreadsheet which is generated by an export from Access.
Column C does not come from Access and is a totals column, basically
Column A - Column B. I have put some conditional formatting on Column
C so that it is red if the value is negative and green if positive. I
have put a calculaion in Column C which is, "=sum(A1-B1)". I realise
that if I drag Column C down, then each cell will become "=sum(A2-B2)"
and "=sum(A3-B3)" etc.

However, my problem is I have no way of knowing how many rows will be
in the spreadsheet. It could be 10 or it could be 10,000. Is there
anyway that I can make Column C always reaslise that it will be Column
A - Column B on the same row, bearing in mind that row 1 is the
header and cannot be included in the calculation?

Thanks for your help

Bobby