Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

If cell does not = previous month

Posted on 2014-07-21
5
Medium Priority
?
244 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

670 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