Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
formula for month that is prior to actual
i generate reports for data collected from the previous month (i.e. in
december, i report for november's data). how do i formulate in my reports the date to show the previous month and year (while automatically updating according to excel date and time)? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
formula for month that is prior to actual
One way
=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),0),"MMM YYYY") -- Regards, Peo Sjoblom "braadi" wrote in message ... i generate reports for data collected from the previous month (i.e. in december, i report for november's data). how do i formulate in my reports the date to show the previous month and year (while automatically updating according to excel date and time)? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
formula for month that is prior to actual
=DATE(IF(MONTH(NOW())=1,YEAR(NOW())-1,YEAR(NOW())),
IF(MONTH(NOW())=1,12,MONTH(NOW())-1), 28) This might be easier to follow if you store intermediate results in cells: A1: =IF(MONTH(NOW())=1,12,MONTH(NOW())-1) A2: =IF(A1=12,YEAR(NOW())-1, YEAR(NOW))) =Date(A2, A1, 28) This assumes that you put the DATE function in a cell formatted to show mm/yyyy. In that case, the day arg to the DATE function is arbitrary and can be any day number which appears in every month (i.e. 1-28). -- Ted |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
formula for month that is prior to actual
great. thanks so much.
"TedMi" wrote: =DATE(IF(MONTH(NOW())=1,YEAR(NOW())-1,YEAR(NOW())), IF(MONTH(NOW())=1,12,MONTH(NOW())-1), 28) This might be easier to follow if you store intermediate results in cells: A1: =IF(MONTH(NOW())=1,12,MONTH(NOW())-1) A2: =IF(A1=12,YEAR(NOW())-1, YEAR(NOW))) =Date(A2, A1, 28) This assumes that you put the DATE function in a cell formatted to show mm/yyyy. In that case, the day arg to the DATE function is arbitrary and can be any day number which appears in every month (i.e. 1-28). -- Ted |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
formula for month that is prior to actual
i appreciate the help so much. look forward to getting this working now.
"Peo Sjoblom" wrote: One way =TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),0),"MMM YYYY") -- Regards, Peo Sjoblom "braadi" wrote in message ... i generate reports for data collected from the previous month (i.e. in december, i report for november's data). how do i formulate in my reports the date to show the previous month and year (while automatically updating according to excel date and time)? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Match then lookup | Excel Worksheet Functions | |||
Formula Problem - interrupted by #VALUE! in other cells!? | Excel Worksheet Functions | |||
Formula checking multiple worksheets | Excel Worksheet Functions | |||
Help with macro formula and variable | Excel Worksheet Functions | |||
How to solve a formula so that it returns actual answer if negati. | Excel Discussion (Misc queries) |