View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Adding calculated value to previous cell

So February 29 would get 300 (29, 30, and 31).
And June 30 would get 200.

I put this in A1:
=DATE(YEAR(TODAY()),1,ROW())

And this in B1:
=Day(a1)

And this in C1:
=IF(MONTH(A1)=MONTH(A1+1),100,3100-100*(DAY(A1)-1))

Then I dragged all three formulas down as far as I needed.

I wasn't sure how your data was laid out, so I dragged it down to row 366.

But if you wanted this stuff on different sheets, you could use this in A1:
=DATE(YEAR(TODAY()),###,ROW())
Replace ### with the month you want for that sheet.

======
Then you could either hide column A

Or convert all the formulas to values by selecting the range
edit|copy
followed by edit|Paste special|Values
and delete column A.



electricbluelady wrote:

Hi everyone,
I have a spreadsheet numbered from 1-31. This represents the maximum of 31
days in a month. However, all months do not contain 31 days. This is an
example of what I am working with: (day and value columns)

1 100
2 100
3 100
. 100
. 100
. 100
28 100
29 0
30 0
31 0

Total 3100 (fixed constant-no matter if there are 28, 29, 30, or 31 days in
the month).

This example is for February (non-leap year) and the month has 28 days. How
do I calculate the 28th day to equal the total of (3100 - the sum of values
from day 1- day 28?) and appear in the cell for day 28? (leaving the cells
for 29, 30, and 31 blank).

(this would need to work also for days 29, 30, and 31).

--
Thank you all again, Regards!
Electricbluelady


--

Dave Peterson