Month based data addition to worksheet

B

Brian

I am building a data base in one worksheet that takes data from another
worksheet. The data is filled in monthly but I want to only fill the data in
if the the month is either current month or prior and keep rolling as the
months advance. I have a method to do this if only dealing with one calendar
year (=IF(Previous Month="","",IF(MONTH(TODAY())>(MONTH(Previous
Month)+1),Previous Month+32,"")), but this of course doesn't work for a
Dec/Jan transition. Any suggestions?

Also, I'm interested in just date stamping MONTH/YEAR...the day is not
important. In my formula I advance the date by 32 days to advance the date
by a month but there obviously would be a few days of the year where the
formula would break down and the output would not yield what I want (for my
purposes this is not a big deal but if there is a better way to do this...)

Thanks in advance.
 
M

Max

.. I want to only fill the data in
if the the month is either current month or prior
and keep rolling as the months advance.

Assuming dates are entered in Sheet2's col A, from A2 down
Perhaps something like this in Sheet1's A2, copied down:
=IF(Sheet2!A2="","",IF(DATE(YEAR(Sheet2!A2),MONTH(Sheet2!A2),1)<=DATE(YEAR(TODAY()),MONTH(TODAY()),1),Sheet2!A2,""))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top