Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Excel2003 - Automatically sum a variable number of rows

How do I automatically sum a variable number of rows between two delimiters?

I get a monthly spreadsheet from an accounting program and add formulas to
it to make it usable for others.

The sheet contains info about projects; each project is a set of a variable
number of rows. There is always a non-bold "F" at the start of the set and a
bold "F" at the end. The end of the set I want to sum is always in the same
position relative to where the sum function is, but I can't work out how to
find the other end, in a formula. This has to be formula driven as there are
too many sets to do it manually.

Example:
A B C
Job1 JobName F
Line1 500
Line2 1000
Line3 1500
Line(n) 1000
Job1 JobName F
(SUM FUNCTION)
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 97
Default Excel2003 - Automatically sum a variable number of rows

Hi Andrew,

Copy following formula in cell D1 ... and all the way down ...
=SUM(C1:INDIRECT(ADDRESS(SUMPRODUCT(MAX((ROW($C$1: C1))*($C$1:C1="F"))),
3,4)))*IF(OFFSET(C1,1,0)="F",1,0)

HTH
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,651
Default Excel2003 - Automatically sum a variable number of rows

You can simplify that a bit.

....)))*IF(OFFSET(C1,1,0)="F",1,0)
can presumably be replaced by
....)))*(OFFSET(C1,1,0)="F")
--
David Biddulph

"Carim" wrote in message
...
Hi Andrew,

Copy following formula in cell D1 ... and all the way down ...
=SUM(C1:INDIRECT(ADDRESS(SUMPRODUCT(MAX((ROW($C$1: C1))*($C$1:C1="F"))),
3,4)))*IF(OFFSET(C1,1,0)="F",1,0)

HTH



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Excel2003 - Automatically sum a variable number of rows

Carim

Many Thanks - that seems to do it - I'll have to study the functions you
have used to understand how they operate. But for now I'll just accept that
they work.

Andrew

"Carim" wrote:

Hi Andrew,

Copy following formula in cell D1 ... and all the way down ...
=SUM(C1:INDIRECT(ADDRESS(SUMPRODUCT(MAX((ROW($C$1: C1))*($C$1:C1="F"))),
3,4)))*IF(OFFSET(C1,1,0)="F",1,0)

HTH

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 97
Default Excel2003 - Automatically sum a variable number of rows

David,

You are right ... with True or False instead of If ...

Thanks


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 97
Default Excel2003 - Automatically sum a variable number of rows

Andrew,

Glad it fixed your problem ...

Thanks for the feedback
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy cells to variable number of rows Acct Supr - DCTC Excel Discussion (Misc queries) 5 September 26th 09 12:58 PM
copy down with variable number of rows mohavv Excel Discussion (Misc queries) 5 November 15th 07 04:18 PM
Linking to a Variable Number of Rows - XP/07 RFJ Excel Worksheet Functions 4 May 17th 07 07:53 PM
Insert Variable Number of Rows; With Loop ryguy7272 Excel Worksheet Functions 2 December 27th 06 08:25 PM
How do I assign a text value to a variable number of rows? Jday Excel Worksheet Functions 6 June 20th 05 01:46 PM


All times are GMT +1. The time now is 12:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"