Hard code date in excel . . .

  • Thread starter Rachel Costanza
  • Start date
R

Rachel Costanza

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
 
P

Peo Sjoblom

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
 
S

ShaneDevenshire

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top