Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
braadi
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
TedMi
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
braadi
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
braadi
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Match then lookup Tenacity Excel Worksheet Functions 9 December 3rd 05 05:30 AM
Formula Problem - interrupted by #VALUE! in other cells!? Ted Excel Worksheet Functions 17 November 25th 05 05:18 PM
Formula checking multiple worksheets sonic-the-mouse Excel Worksheet Functions 2 June 5th 05 07:48 PM
Help with macro formula and variable Huge project Excel Worksheet Functions 0 December 28th 04 01:27 AM
How to solve a formula so that it returns actual answer if negati. Wayne Excel Discussion (Misc queries) 2 December 22nd 04 07:46 PM


All times are GMT +1. The time now is 09:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"