hi all,
quick and easy one - if i wanted to show only previous month results. how would i do it.
if i had a cell that had a date in it (not today() but actual date 1/2/07) how would i have it so its cell minus one month?
Thanks
Joel
hi all,
quick and easy one - if i wanted to show only previous month results. how would i do it.
if i had a cell that had a date in it (not today() but actual date 1/2/07) how would i have it so its cell minus one month?
Thanks
Joel
If you have 01/02/2007 in A1, then
=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1)) will be 1 month before
oldchippy
-------------
Blessed are those who can give without remembering and take without forgetting
If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.
Click here >>> Top Excel links for beginners to Experts
Forum Rules >>>Please don't forget to read these
thanks old chippy.
joel
thanks old chippy.
the only prob with that is what is its the first month of the year would it still work?
Cheers
joel
Last edited by dj_siek; 03-01-2007 at 09:02 PM.
Yes, it would just go to the previous month i.e. December the previous year. If you didn't want to show a date if it was the previous year, thenOriginally Posted by dj_siek
=IF(MONTH(A1)=1,"",DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))) which say's if the month in A1 is 1 (January), display blank, otherwise show date one month previous.
What might the date be, could it be any day in the month? If you have 31st March 2007 in A1 what result would you want?Originally Posted by dj_siek
If you use the formula
=DATE(YEAR(A1),MONTH(A1)-1,DAY(A1))
this will give 3rd March 2007. If you want to get 28th Feb 2007 then perhaps try using EDATE from Analysis ToolPak,
=EDATE(A1,-1)
You're right DDL, forgot about those short months - again!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks