+ Reply to Thread
Results 1 to 17 of 17

Highlight next ODD NUMBER months in range

  1. #1
    Forum Contributor
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    101

    Highlight next ODD NUMBER months in range

    Greetings, esteemed members of the Excel community

    I'm trying to come up with a conditional formatting formula to highlight the dates that belong in the next ODD NUMBER months (1, 3, 5, 7 etc) along the range regardless of what first date is.

    Dates belong in the same month as the first date remain non-highlighted. Only the dates belong in the next 1, 3, 5 etc months will be highlighted.

    I'm sure the solution is quite simple, but for some reason I'm drawing a complete blank.
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Highlight next ODD NUMBER months in range

    I don't understand your Q. Please manually shade cells to show the desired result.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,749

    Re: Highlight next ODD NUMBER months in range

    CF rule for B4:

    =ISODD(MONTH(B4))

    Applies to: =$B$4:$B$35

    AliGW on MS365 Beta Channel (Windows 11) 64 bit

    B
    3
    DATES
    4
    02/06/2024
    5
    09/06/2024
    6
    16/06/2024
    7
    26/06/2024
    8
    02/07/2024
    9
    08/07/2024
    10
    16/07/2024
    11
    22/07/2024
    12
    28/07/2024
    13
    06/08/2024
    14
    15/08/2024
    15
    22/08/2024
    16
    29/08/2024
    17
    06/09/2024
    18
    12/09/2024
    19
    20/09/2024
    20
    26/09/2024
    21
    05/10/2024
    22
    15/10/2024
    23
    21/10/2024
    24
    29/10/2024
    25
    05/11/2024
    26
    12/11/2024
    27
    21/11/2024
    28
    01/12/2024
    29
    11/12/2024
    30
    17/12/2024
    31
    24/12/2024
    32
    30/12/2024
    33
    07/01/2025
    34
    17/01/2025
    35
    26/01/2025
    Sheet: Sheet1
    Attached Files Attached Files
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,111

    Re: Highlight next ODD NUMBER months in range

    i'm not sure i follow exactly - if you just want to highlight months that are ODD
    =ISODD(MONTH(B4))
    but i dont think thats what you are after and you are not showing an expected results , are you able to put some expected results and why in the sample and on the text in the question
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Highlight next ODD NUMBER months in range

    One guess:

    =ISODD(month(B4))

    applied to B4:B40
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    101

    Re: Highlight next ODD NUMBER months in range

    @Glenn like Ali posted

    @Ali The problem with that solution is, when I change the first date to July, then the first month is highlighted, which I do not want. If the first month is June; months July, September, etc are highlighted. But if the first month is July; months like August, October, etc are highlighted. That's the part that stumped me.

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,749

    Re: Highlight next ODD NUMBER months in range

    Try this:

    =AND(MONTH(B4)<>MONTH(TODAY()),ISODD(MONTH(B4)))

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Highlight next ODD NUMBER months in range

    Select the cells B4:B35, then click on Conditional Formatting | New Rule | Use a formula... , then put this formula in the dialogue box which pops up:

    =ISODD(MONTH(B4))

    Click on the Format button | Fill tab and choose your colour, then OK your way out.

    Hope this helps.

    Pete

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

    Re: Highlight next ODD NUMBER months in range

    No - try this instead:

    =AND(MONTH(B4)<>MONTH($B$4),ISODD(MONTH(B4)))
    Attached Files Attached Files

  10. #10
    Forum Contributor
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    101

    Re: Highlight next ODD NUMBER months in range

    Reattached the file. Sorry for confusion, I thought the wording was clear.
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,176

    Re: Highlight next ODD NUMBER months in range

    CF rule for cell B5:

    =MOD(MONTH(B5),2)<>MOD(MONTH($B$4),2)

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,749

    Re: Highlight next ODD NUMBER months in range

    See post #9.

  13. #13
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Highlight next ODD NUMBER months in range

    Further to Post #6, use this formula for the CF rule instead:

    =MOD(MONTH(B4),2)<>MOD(MONTH($B$4),2)

    Hope this helps.

    Pete

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,749

    Re: Highlight next ODD NUMBER months in range

    That's completely different!

    Try this:

    =OR(AND(ISODD(MONTH($B$4)),ISEVEN(MONTH(B4)),AND(ISEVEN(MONTH($B$4)),ISODD(MONTH(B4)))

    I thought the wording was clear.
    It really was not and you never mentioned even months needing to be highlighted. Moral of the tale: always provide a very clear worked example in a workbook!
    Last edited by AliGW; 06-13-2024 at 11:25 AM.

  15. #15
    Forum Contributor
    Join Date
    11-13-2018
    Location
    Istanbul
    MS-Off Ver
    Microsoft 365
    Posts
    101

    Re: Highlight next ODD NUMBER months in range

    Thank you all so much for quick responses!

    Pete's solution is quite clean and works beautifully! Thank you again!

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    90,749

    Re: Highlight next ODD NUMBER months in range

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED. You can also access the SOLVED tag by editing the opening post and choosing SOLVED from the drop-down to the left of the title box.

    Also, if you have not already done so, remember that you can reward anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

  17. #17
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Highlight next ODD NUMBER months in range

    Glad to help, and thanks for the rep.

    Pete

+ 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. Replies: 3
    Last Post: 06-02-2020, 12:12 PM
  2. [SOLVED] find number of months within range of dates
    By rs1aj in forum Excel General
    Replies: 7
    Last Post: 06-02-2015, 01:36 PM
  3. How to calculate number of months by date range for a specific year?
    By redstyles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-20-2015, 05:53 PM
  4. Formula to count the number of different months in a range
    By Fishkeeper in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 10-23-2013, 10:37 AM
  5. [SOLVED] Count the number of whole calandar months in a date range
    By robfresh in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 10-19-2012, 05:28 AM
  6. Replies: 3
    Last Post: 07-31-2012, 04:44 PM
  7. [SOLVED] Can i count the number of months in a specific range
    By radicrains in forum Excel General
    Replies: 12
    Last Post: 09-21-2011, 03:06 AM

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