View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
tim m tim m is offline
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?