+ Reply to Thread
Results 1 to 6 of 6

Finding Mismatched Months

  1. #1
    Registered User
    Join Date
    04-19-2013
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    5

    Finding Mismatched Months

    Hello, I need some help please. In the attached file I am trying to find any mismatches between the month in column A and the month number in column B. Is there a formula or macro that will give me, in column C perhaps, a TRUE if the months match and a FALSE if the months do not match?

    Thank you in advance.

    Mismatched Months.xls
    Last edited by Tim Kennedy; 05-02-2013 at 05:48 PM.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Finding Mismatched Months

    You can probably do a TextToColumns on Column A then use formula to compare the month between the two columns.
    Attached Files Attached Files

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Finding Mismatched Months

    Try this:

    Please Login or Register  to view this content.
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,926

    Re: Finding Mismatched Months

    If you want just the month (as you said), ConneXionLost's formula will give you what you need. If you want to include the year as well, try this...

    =TEXT(MONTH(B1),"mmm")&" "&RIGHT(YEAR(B1),2)=MID(A1,LEN(A1)-5,99)

    I noticed that in both cases, it becomes a little hard to see the TRUE's from the FALSE"s, have you considered using conditional formatting to change the color of the cells that match?

    1. highlight the range you want to apply the conditional formatting to (say, C1:C1000)
    2. on the home tab, styles, select CF
    3. select new rule, select use formula
    4. enter =MID(A1,LEN(A1)-5,3)=UPPER(TEXT(B1,"mmm"))

    or if you want to include the year as well...

    4. enter =TEXT(MONTH(B1),"mmm")&" "&RIGHT(YEAR(B1),2)=MID(A1,LEN(A1)-5,99)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    04-19-2013
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding Mismatched Months

    You are truly a real guru. Thanks.

  6. #6
    Registered User
    Join Date
    04-19-2013
    Location
    New Jersey
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Finding Mismatched Months

    Thank you for the response. This is a great forum and I will be using it more as I further work with and learn excel.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1