+ Reply to Thread
Results 1 to 20 of 20

Highlight entire row if cells in column contain last, this, or next month.

  1. #1
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Highlight entire row if cells in column contain last, this, or next month.

    Peace,
    I'm sure this is easy. I want to use a conditional formatting formula to highlight the entire row if any cell in column B contain last, this, or next month. I probably will need to use 3 different conditional formatting formulas (one for each time frame).

    Thanks
    Attached Images Attached Images

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Capture.JPG
    Here is a picture of the conditional formatting
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Thanks, but that doesnt apply to the entire row. It only highlights the cells containing the specified time frame.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Probably need to do this with VBA. Are you comfortable with a VBA solution?
    Last edited by alansidman; 11-03-2018 at 10:50 PM.

  5. #5
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: Highlight entire row if cells in column contain last, this, or next month.

    ok. Here is a vba solution
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Thanks, if thats the only way to go. I dont know how to create/edit the code, but I pasted and it worked, however, (I didnt think about this)...can you specify the entire row within the table, not across the whole sheet?

  7. #7
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Use this:

    Conditional formatting - Manage rules...
    New 3 new rules - Use a formula to determine which cell to format:
    The formulas are:
    Last month
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    This month
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Next month
    Formula: copy to clipboard
    Please Login or Register  to view this content.




    image2.JPG
    You can make "Applies to" as big as you need.


    If you prefer the same format for all three options, just need one rule:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by LeoSkywalker; 11-04-2018 at 12:27 AM.

  8. #8
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Thanks LeoSkywalker, works perfectly! and no VBA! I knew it could be done. Do you guys use a program to input what you want and it outputs the correct formula, or do you just know the code? Is there a list of codes?

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Highlight entire row if cells in column contain last, this, or next month.

    We work it out from what we have learned already!!!

    https://support.office.com/en-us/art...1-63f26a86c0eb
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,907

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Lots of trying different things and reading lots of threads in forums. Watching You Tube videos.

  11. #11
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Asabur,

    As Ali and Alan said, there are a lot of resources to learn, we never stop learning, we come here and help one another, several times we come up with a solution for a problem, and then someone else comes with a better one, we learn from there, too.

    Don't forget to mark threads as "Solved" if your problem has been solved.
    If an answer helped you, show your appreciation by clicking * Add Reputation at the bottom left corner of the message.
    Last edited by LeoSkywalker; 11-04-2018 at 02:12 PM.

  12. #12
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Hi LeoSkywalker,
    This formula did work until I had to enter 2/21/2020. How do I make sure it only highlights last month (including Dec of previous year), this month, and next month (including Jan of next year). I only want bills that are past due, due currently, and due next month, a rolling 12-month period. If that helps. Thanks

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Try this:

    =AND($B2<=EDATE(TODAY(),1),$B2>=(EDATE(TODAY(),-1)

    or this:

    =AND($B2<=EOMONTH(TODAY(),1),$B2>=EOMONTH(TODAY(),-2)+1)
    Last edited by AliGW; 01-30-2019 at 12:27 AM.

  14. #14
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    • =AND($B2<=EDATE(TODAY(),1),$B2>=(EDATE(TODAY(),-1) is missing parenthesis. I cant figure out where.
    • =AND($B2<=EOMONTH(TODAY(),1),$B2>=EOMONTH(TODAY(),-2)+1) returns nothing.Adia excel.JPG

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    81,162

    Re: Highlight entire row if cells in column contain last, this, or next month.

    The first one needs an extra bracket at the end. If you need further help, please update the actual spreadsheet - I cannot troubleshoot a picture.

  16. #16
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    It still says missing parenthesis. Im sorry, I knew that I could upload a file since Ive done it before, but I was moving too fast and couldnt find how to. Here it is now.

    Thanks
    Attached Files Attached Files

  17. #17
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Highlight entire row if cells in column contain last, this, or next month.

    Please try CF fromula applies to A5:F20

    =TEXT(TODAY(),"myy")=TEXT($D5,"myy") > this month

    =TEXT(EDATE(TODAY(),-1),"myy")=TEXT($D5,"myy") > last month

    =TEXT(EDATE(TODAY(),1),"myy")=TEXT($D5,"myy") > next month


    There is no 31-Feb D7 is text not date.

    Your others formula should refer to $D5, not $B2
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    @Bo_Ry
    I must be doing something wrong (see pic). Its not returning anything. I have each formula applied to A5:F20 and are referring to D5 as you said. Are you able to edit the conditional formatting for me, in the file I attached?
    excel snippet.jpg
    Attached Images Attached Images

  19. #19
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,213

    Re: Highlight entire row if cells in column contain last, this, or next month.

    The fomula is just this. not include the "> this month"

    =TEXT(TODAY(),"myy")=TEXT($D5,"myy")
    =TEXT(EDATE(TODAY(),-1),"myy")=TEXT($D5,"myy")

    Please download the file from Post#17 to see

  20. #20
    Registered User
    Join Date
    08-21-2012
    Location
    East Coast, US
    MS-Off Ver
    365 and Desktop
    Posts
    42

    Re: Highlight entire row if cells in column contain last, this, or next month.

    @Bo_Ry
    Oh I'm sorry, didnt see the download before. Thank you so much, I got them all now!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Highlight entire column is two values = the same!
    By LeeBillington in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-14-2018, 12:36 PM
  2. [SOLVED] this code colors entire row but i only want it to highlight from Column A to Column H
    By Jenkins27 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2015, 09:36 PM
  3. Highlight Entire Row & Column
    By rajeev.raj in forum Excel General
    Replies: 3
    Last Post: 06-22-2014, 03:41 AM
  4. [SOLVED] how to highlight the entire column in a sheet
    By catchnanan in forum Excel General
    Replies: 10
    Last Post: 07-10-2013, 03:08 PM
  5. Replies: 0
    Last Post: 07-22-2011, 12:11 PM
  6. Replies: 5
    Last Post: 03-18-2011, 03:32 PM
  7. Highlight entire row based on value in a column c
    By ramky79 in forum Excel General
    Replies: 3
    Last Post: 10-27-2010, 01:40 PM

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