Previous month based on current month

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
830
Office Version
  1. 365
Platform
  1. Windows
I am using the following formula to return the current month.

=TEXT(TODAY(),"MMMM")

However I would like to return the previous month. I know that if it were the year, I can just add -1 to the end of the formula, but that returns #VALUE when tried with the MMMM format.

Thanks,
Matthew
 
Very interesting thread,
Just had this come up in the office... and My coworker and I came up with the same solution Aladin did.
We did have a different solution to the one presented by Suavis for the "two months ago" scenario.

=TODAY()-DAY(TODAY())-DAY(TODAY()-DAY(TODAY()))

While not efficient if you had numerous places you had to use it, it's a pretty effective way to get the month before last month.
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
You could also just use EOMONTH:

=EOMONTH(TODAY(),-2)

This has been included as a standard function since XL2007.
 
Upvote 0
A1: =TODAY()
B1:B10000: =TEXT($A$1-DAY($A$1),"MMMM")

In this scenario, Today is only calculated once in A1
Then you have 10000 cells referring to A1.


Hello:

Excel says the formula below has an error. Could you help me fix it?

="DEDUCT deposits made in TEXT($F$1-DAY($F$1),mmmm") but recorded in QB in "&TEXT(F1,"mmmm")

F1=02/18/16

so the formula should return DEDUCT deposits made in Jan but recorded in QB in Feb

Thanks or your help

Sean
 
Upvote 0
Looks like youy have some "" in the wrong places...
="DEDUCT deposits made in "&TEXT($F$1-DAY($F$1),mmmm")&" but recorded in QB in "&TEXT(F1,"mmmm")
 
Upvote 0
Looks like youy have some "" in the wrong places...
="DEDUCT deposits made in "&TEXT($F$1-DAY($F$1),mmmm")&" but recorded in QB in "&TEXT(F1,"mmmm")


Excellent with one small change per Excel correction:

="DEDUCT deposits made in "&TEXT($F$1-DAY($F$1),"mmmm")&" but recorded in QB in "&TEXT(F1,"mmmm")

The 1st ,mmmm" should be ,"mmmm"


Thank you so very much

Sean
 
Last edited:
Upvote 0
Bringing up an old subject that I'm hoping you all can help with... I need to display "Current Month" If the date in a cell is in the current month of need to display "Previous Month" if the date in a cell is in the previous month, else, make the cell blank.

The formulate i have at the moment is =if(month(today()-1=month(today(Y2)), "Previous Month", if(month(today()=month(today(Y2)), "Current Month", ""))))

Obviously, it's not working. Please help!
 
Upvote 0
=IF(MONTH(Y2)=MONTH(TODAY()),"Current Month",IF(MONTH(Y2)=MONTH(EOMONTH(TODAY(),-1)),"Previous Month",""))
 
Upvote 0
This partially gets me there.

Because the data includes several years, the result of the above formula is that both, December if 2018 and December of 2017 are being counted as "Previous Month" and the same goes for Current Month.

I tried the following but, no go...

=IF(and(year(Y2), MONTH(Y2))= and(year(today(), MONTH(TODAY()),"Current Month", IF(and(year(Y2), MONTH(Y2))= and(year(today(), MONTH(EOMONTH(TODAY(),-1)),"Previous Month",""))))))
 
Upvote 0

Forum statistics

Threads
1,222,642
Messages
6,167,267
Members
452,107
Latest member
cami_dev

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top