#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Sum Formula

Hello,

I am trying to develop a formula from the following data sample that will
sum all values belonging to the same account number and period.

Account Period Amount
300000-0000-11-0000-71 1 (238,662)
300000-0000-11-0000-71 1 376
300000-0000-11-0000-71 2 (345,830)
300000-0000-11-0000-71 2 5,757
300000-0000-11-0000-71 2 (49,943)
300000-0000-11-0000-71 3 (25,671)
300000-0000-11-0000-71 3 (48,710)
300000-0000-11-0000-71 3 (305,829)
300000-0000-11-0000-71 3 399
300000-0000-11-0000-71 3 (108,489)

For example, the formula should sum the first two lines since they are the
same account number and same period. Lines 3-5 should be summed, and so
forth. I think it would be a SumIf formula, but I am not sure how to handle
2 criteria (account and period). The data I have is 4000 lines so doing
these formulas manually is not an option.

Any help is much appreciated.

John






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Sum Formula

haven't tried a formula for you yet, since i am not sure of what your after,
have you tried the subtotal menu option?
select the columns
click data/subtotals
set the first option to at each change in period
and sum the amount column

if the accounts aren't in order, sort the data before.

if you want to automate it, record a macro as you perform each operation.

if you're looking for something else, i am sure someone will post some code

--


Gary


"John M" wrote in message
...
Hello,

I am trying to develop a formula from the following data sample that will
sum all values belonging to the same account number and period.

Account Period Amount
300000-0000-11-0000-71 1 (238,662)
300000-0000-11-0000-71 1 376
300000-0000-11-0000-71 2 (345,830)
300000-0000-11-0000-71 2 5,757
300000-0000-11-0000-71 2 (49,943)
300000-0000-11-0000-71 3 (25,671)
300000-0000-11-0000-71 3 (48,710)
300000-0000-11-0000-71 3 (305,829)
300000-0000-11-0000-71 3 399
300000-0000-11-0000-71 3 (108,489)

For example, the formula should sum the first two lines since they are the
same account number and same period. Lines 3-5 should be summed, and so
forth. I think it would be a SumIf formula, but I am not sure how to
handle
2 criteria (account and period). The data I have is 4000 lines so doing
these formulas manually is not an option.

Any help is much appreciated.

John








  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Sum Formula

I suppose you could fool around with some SUMPRODUCT or SUMIF formulae but
really in this case a pivot table should be used and you will have your
answer in no time at all. The good news is pivot tables are in fact very
easy to use.

If you don't know how to generate a pivot table, here's a link to get you
started:

http://www.windowsdevcenter.com/pub/...le.html?page=1

"John M" wrote in message
...
Hello,

I am trying to develop a formula from the following data sample that will
sum all values belonging to the same account number and period.

Account Period Amount
300000-0000-11-0000-71 1 (238,662)
300000-0000-11-0000-71 1 376
300000-0000-11-0000-71 2 (345,830)
300000-0000-11-0000-71 2 5,757
300000-0000-11-0000-71 2 (49,943)
300000-0000-11-0000-71 3 (25,671)
300000-0000-11-0000-71 3 (48,710)
300000-0000-11-0000-71 3 (305,829)
300000-0000-11-0000-71 3 399
300000-0000-11-0000-71 3 (108,489)

For example, the formula should sum the first two lines since they are the
same account number and same period. Lines 3-5 should be summed, and so
forth. I think it would be a SumIf formula, but I am not sure how to

handle
2 criteria (account and period). The data I have is 4000 lines so doing
these formulas manually is not an option.

Any help is much appreciated.

John








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
Commenting custom formula fields/formula on formula editor Muxer Excel Programming 2 July 24th 03 01:02 AM


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

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

About Us

"It's about Microsoft Excel"