ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   formula for previous month (https://www.excelbanter.com/excel-discussion-misc-queries/199557-formula-previous-month.html)

drose

formula for previous month
 
I have a form that I fill out each month for the previous month. Is there a
way or formula to automatically have the previous month post?

ExcelBanter AI

Answer: formula for previous month
 
Automatically Displaying the Previous Month in Excel

Yes, there is a formula that you can use to automatically display the previous month in your form. You can use the
Formula:

EOMONTH 

function in Excel to achieve this. Here are the steps:
  1. In the cell where you want to display the previous month, type the following formula: =EOMONTH(TODAY(),-2)+1
  2. Press Enter to apply the formula. The cell should now display the first day of the previous month.
  3. If you want to display the entire previous month, you can use the following formula instead: =EOMONTH(TODAY(),-2)+1&"-"&EOMONTH(TODAY(),-1)
  4. Press Enter to apply the formula. The cell should now display the entire previous month in the format "MM/DD/YYYY-MM/DD/YYYY".

Note that the
Formula:

TODAY() 

function in the formula returns the current date, so the formula will always display the previous month based on the current date. If you want to display the previous month based on a specific date, you can replace
Formula:

TODAY() 

with that date in the formula.

John C[_2_]

formula for previous month
 
By post... you mean what exactly?
To get the 1st day of the previous month, you could just use the following
formula:
=DATE(YEAR(TODAY()),MONTH(TODAY())-1,1)
--
John C


"drose" wrote:

I have a form that I fill out each month for the previous month. Is there a
way or formula to automatically have the previous month post?


Pete_UK

formula for previous month
 
Try this:

=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()-1),DAY(TODAY())),"mmmm")

This will change (potentially) every day.

Hope this helps.

Pete

On Aug 20, 9:52*pm, drose wrote:
I have a form that I fill out each month for the previous month. *Is there a
way or formula to automatically have the previous month post?



John C[_2_]

formula for previous month
 
I think you got a parenthetical in the wrong place.
=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()-1),DAY(TODAY())),"mmmm")
should be
=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY())-1,DAY(TODAY())),"mmmm")
--
John C


"Pete_UK" wrote:

Try this:

=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()-1),DAY(TODAY())),"mmmm")

This will change (potentially) every day.

Hope this helps.

Pete

On Aug 20, 9:52 pm, drose wrote:
I have a form that I fill out each month for the previous month. Is there a
way or formula to automatically have the previous month post?




Pete_UK

formula for previous month
 
Thanks for pointing that out, John.

Pete

On Aug 20, 10:12*pm, John C <johnc@stateofdenial wrote:
I think you got a parenthetical in the wrong place.
=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()-1),DAY(TODAY())),"mmmm")
should be
=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY())-1,DAY(TODAY())),"mmmm")
--
John C



"Pete_UK" wrote:
Try this:


=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()-1),DAY(TODAY())),"mmmm")


This will change (potentially) every day.


Hope this helps.


Pete


On Aug 20, 9:52 pm, drose wrote:
I have a form that I fill out each month for the previous month. *Is there a
way or formula to automatically have the previous month post?- Hide quoted text -


- Show quoted text -



Dave Peterson

formula for previous month
 
=today()-day(today())
will give the last day of the previous month.

Then you can format this cell to just show the month (or month and year):
mmmm yyyy



drose wrote:

I have a form that I fill out each month for the previous month. Is there a
way or formula to automatically have the previous month post?


--

Dave Peterson


All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com