Solved

If cell does not = previous month

Posted on 2014-07-21
5
235 Views
Last Modified: 2014-07-21
Hi, i have the formula to deal with previous month

=TEXT(DATE(2004,IF(MONTH(TODAY())-1>0,MONTH(TODAY())-1,12),1),"MMMM")

I have a drop down in cell F5 that has a list of months

I want an if statement in cell H5 which says, if the drop down does not equal the previous month, "You are dealing with incorrect month"

Thanks
0
Comment
Question by:Seamus2626
  • 2
  • 2
5 Comments
 
LVL 19

Expert Comment

by:helpfinder
ID: 40208647
check my attached sample
sample.xlsx
0
 

Author Comment

by:Seamus2626
ID: 40208658
Helpfinder, if i select Jun on the dropdown, and enter your formula, i still get

"You are dealing with incorrect month"

Whereas i would be dealing with the correct month i.e. current month - 1

Thanks
0
 
LVL 19

Accepted Solution

by:
helpfinder earned 500 total points
ID: 40208682
Hi,
I put drop down menu into F5 cell and IF formula into H5. IF formula contains also your formula =TEXT(DATE(2004,IF(MONTH(TODAY())-1>0,MONTH(TODAY())-1,12),1),"MMMM")

Where are you entering formula?

Anyway I update the sample file - checkt row 10, so drop down is in F5, your formula in G5 and IF statement in H5
sample.xlsx
0
 

Author Closing Comment

by:Seamus2626
ID: 40208703
Perfect, thanks
0
 
LVL 24

Expert Comment

by:Steve
ID: 40208721
Seamus, your formula for previos month seems a tad complicated for your needs:

Last day of previous month = TODAY() - DAY(TODAY())

So previous month = TEXT( TODAY() - DAY( TODAY() ) , "mmmm" )
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now