ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Hard code date in excel . . . (https://www.excelbanter.com/excel-discussion-misc-queries/209505-hard-code-date-excel.html)

Rachel Costanza[_2_]

Hard code date in excel . . .
 
I have a an excel workbook with 15 worksheets that I have to update the prior
month and current year on every month to produce a turnover report. Can I
use VB or a DATE function to do this?

I have tried =TEXT(TODAY(),"mmmm") but that only gives me the current month
and not the year. I need the prior month and current year.

Any help is appreciated!

Best,

Rachel Costanza

Peo Sjoblom[_2_]

Hard code date in excel . . .
 
I don't know what you mean by hard code in this respect but this formula
will give you previous month and current year

=TEXT(DATE(YEAR(TODAY()),MONTH(TODAY()),0),"mmmm yyyy")

--


Regards,


Peo Sjoblom

"Rachel Costanza" wrote in
message ...
I have a an excel workbook with 15 worksheets that I have to update the
prior
month and current year on every month to produce a turnover report. Can I
use VB or a DATE function to do this?

I have tried =TEXT(TODAY(),"mmmm") but that only gives me the current
month
and not the year. I need the prior month and current year.

Any help is appreciated!

Best,

Rachel Costanza




ShaneDevenshire

Hard code date in excel . . .
 
Hi,

If all you need is to display the current year and prior month:
=EDATE(TODAY(),-1) displays the prior month when you format it to MMMM
(you don't need the TEXT function, just use Format, Cells, Number tab, Custom
=TODAY() just format this to the custom format YYYY same as above, don't
need the TEXT function although both of these can be used with the text
function.

EDATE is part of the Analysis ToolPak in 2003 and earlier, so you might have
to attach it by choosing Tools, Add-ins, and checking it.
--
Thanks,
Shane Devenshire


"Rachel Costanza" wrote:

I have a an excel workbook with 15 worksheets that I have to update the prior
month and current year on every month to produce a turnover report. Can I
use VB or a DATE function to do this?

I have tried =TEXT(TODAY(),"mmmm") but that only gives me the current month
and not the year. I need the prior month and current year.

Any help is appreciated!

Best,

Rachel Costanza



All times are GMT +1. The time now is 11:21 PM.

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