Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 430
Default Counting number of cells that make up a sum..

Greetings: Here is my problem,

I have a column of numbers (Building areas in sqm). The column will be
sorted from highest to lowest. I have a number from a calculation I obtain
elsewhere. I need to count the minimum and maximum number of cells in the
column that will be add up to be greater than my calculated number.

For example:

Column A
20000
10000
9000
8000
7000
5000
1000
500
300
200
100

My calculated number is 25000 thus I need to sum from the top of the
column. The 1st two cells sum than 25000 thus my minimum is 2
I then need to sum from the bottom of the list until the sum 25000. At
the 9000 cell the sum is 25000 thus the maximum would be 9

(Of course I have alot more areas of varying sizes in the real spreadsheet.)

What formula might I use to accomplish this?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 256
Default Counting number of cells that make up a sum..

Try the following formulas which need to be confirmed with
CONTROL+SHIFT+ENTER, not just ENTER...

=MATCH(TRUE,SUBTOTAL(9,OFFSET(A2:A12,,,ROW(A2:A12)-ROW(A2)+1))B2,0)

and

=MATCH(TRUE,SUBTOTAL(9,OFFSET(A2:A12,ROWS(A2:A12)-1,,-(ROW(A2:A12)-ROW(A2
)+1)))B2,0)

Hope this helps!

In article ,
tim m wrote:

Greetings: Here is my problem,

I have a column of numbers (Building areas in sqm). The column will be
sorted from highest to lowest. I have a number from a calculation I obtain
elsewhere. I need to count the minimum and maximum number of cells in the
column that will be add up to be greater than my calculated number.

For example:

Column A
20000
10000
9000
8000
7000
5000
1000
500
300
200
100

My calculated number is 25000 thus I need to sum from the top of the
column. The 1st two cells sum than 25000 thus my minimum is 2
I then need to sum from the bottom of the list until the sum 25000. At
the 9000 cell the sum is 25000 thus the maximum would be 9

(Of course I have alot more areas of varying sizes in the real spreadsheet.)

What formula might I use to accomplish this?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 430
Default Counting number of cells that make up a sum..

works nicely, thanks! Now I have to reverse engineer it to see why it works
for my own curiosity. :O)

"Domenic" wrote:

Try the following formulas which need to be confirmed with
CONTROL+SHIFT+ENTER, not just ENTER...

=MATCH(TRUE,SUBTOTAL(9,OFFSET(A2:A12,,,ROW(A2:A12)-ROW(A2)+1))B2,0)

and

=MATCH(TRUE,SUBTOTAL(9,OFFSET(A2:A12,ROWS(A2:A12)-1,,-(ROW(A2:A12)-ROW(A2
)+1)))B2,0)

Hope this helps!

In article ,
tim m wrote:

Greetings: Here is my problem,

I have a column of numbers (Building areas in sqm). The column will be
sorted from highest to lowest. I have a number from a calculation I obtain
elsewhere. I need to count the minimum and maximum number of cells in the
column that will be add up to be greater than my calculated number.

For example:

Column A
20000
10000
9000
8000
7000
5000
1000
500
300
200
100

My calculated number is 25000 thus I need to sum from the top of the
column. The 1st two cells sum than 25000 thus my minimum is 2
I then need to sum from the bottom of the list until the sum 25000. At
the 9000 cell the sum is 25000 thus the maximum would be 9

(Of course I have alot more areas of varying sizes in the real spreadsheet.)

What formula might I use to accomplish this?


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
Formula for counting number of cells Pawan Excel Discussion (Misc queries) 2 February 22nd 06 05:20 AM
Counting the number of cells within a certain hour. Joker Excel Discussion (Misc queries) 10 February 18th 06 03:04 PM
Can I make the number in one cell automatically appear elsewhere? holmeshouse Excel Worksheet Functions 2 August 17th 05 01:12 PM
Number format exactly the same, displays differently in some cells eider Excel Discussion (Misc queries) 1 July 29th 05 12:26 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 09:39 PM.

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"