View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave O Dave O is offline
external usenet poster
 
Posts: 427
Default Adding calculated value to previous cell

Here's one way: if you try this, make sure you have an Add-In called
"Analysis Toolpak" enabled on your version of Excel. (On the menu
click Tools Add-Ins and check the Analysis Toolpak box.)

How about a slightly different tack, such as adding up all the days
that are less than or equal to the last day in this month.

I mocked up your data with day numbers in column A and amounts per day
in column B. I derived this formula:
=SUMPRODUCT(--(DAY(EDATE(DATEVALUE("2/1/" & YEAR(NOW())),1)-1)=$A$1:$A
$30),$B$1:$B$30)

DateValue converts a text representation of a date to an Excel date
value. This could be a cell reference. I've used Year (Now()) to make
this scaleable from year to year.

EDate( date , 1) -1 finds the date of the last day in the relevant
month.

Day derives a day number in the month.

Sumproduct with a unary operator performs a SUMIF- like function to
add days that are less than or equal to the number of days in the
month.

Dave O
Eschew obfuscation