![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 3
|
I am looking for a simple way to update a simple calculation each month to pull the current month into an addition calculation.
ex: J F M A M J J A S O N D (months in the year) At the end of march I want to add March data to a YTD calculation which already pulls Jan and Feb data. So instead of doing this manually several times, I would like to put one formula in the YTD column which will be a function of Now(). It seems as though there has to be a way to do this b'c it is such a simple concept. THANKS! |
|
|
|
|
|
#2 |
|
Join Date: May 2002
Posts: 73
|
If your YTD column is column A, and your month headings are in B1:M1, then :-
- make sure the dates in the headings are all the last day of each month (can be formatted as mmm) - put this formula in A2 and fill down =SUMIF(B$1:M$1,"<=" &TODAY(),B2:M2) |
|
|
|
|
|
#3 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
thinking along dimrod's lines, the correct formula would be ... =SUMIF(B1:M1,"<="&MONTH(TODAY()),B2:M2) provided the entries in B1:M1 are 1,2,3, ... and 12 instead of J F M, ... Please post back if it works for you ... otherwise explain a little further and let us take it from there. Regards! _________________ Yogi Anand Edit: Deleted inactive web site reference from hard code signature line [ This Message was edited by: Yogi Anand on 2003-01-19 17:12 ] |
|
|
|
|
|
|
#4 |
|
Join Date: May 2002
Posts: 73
|
But don't forget the absolute refs for B1:M1
|
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Posts: 3
|
Thanks!
This did work. However, after thinking about it. I actually want to be able to type in a month or its corresponding month no. and make the formula a function of that. I am reporting at the end of a month info for the prior month YTD. So, in May I want the formula to pull all info for Jan - April. I also need to save documents for each month and would not want to use now() or today() because it will be updated all monthly reports for each new month. Let me know if you have anymore thoughts. |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Apr 2002
Location: Sarasota, FL
Posts: 1,539
|
You could have your macro for generating the report cut and paste the data from the month you specify to a 'current' tab. Then have your report tab lookup its values from only the 'current' tab.
Corticus |
|
|
|
|
|
#7 |
|
New Member
Join Date: May 2002
Posts: 3
|
SUMIF(MONTH(B$15:M$15),"<="&MONTH(A1),B16:M16)
This is the formula that I am trying to use but it gives me an error message. I am formating the dates as such and making the formula a function of MONTH(). January-02 February-02 March-02 |
|
|
|
|
|
#8 | |
|
MrExcel MVP
Join Date: Mar 2002
Location: Michigan USA
Posts: 11,452
|
Quote:
=SUMIF(B15:M15,"<="&A15,B16:M16) Regards! |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|