+ Reply to Thread
Results 1 to 3 of 3

Apply conditional formatting to multiple cells merged on a row from a data merged row

  1. #1
    Registered User
    Join Date
    06-12-2022
    Location
    France
    MS-Off Ver
    Microsoft® Excel® for Microsoft 365 MSO (Version 2205 Build 16.0.15225.20172) 64-bit
    Posts
    1

    Apply conditional formatting to multiple cells merged on a row from a data merged row

    Hello,

    This is my first post here, just registered
    I'm seeking your help for the following problem:

    I'm struggling with conditional formatting. In normal situations it's alright, but for aesthetic purposes some cells (one from which I take data to know whether or not to apply the formatting, and others to which I wish to apply said formatting) are merged and span multiple columns (i.e. they are merged on the row/horizontally).

    What I'm trying to do is highlight all the cells that correspond to the current date.
    Right now, June 12th, I can see the 12th of every month highlighted for the metrics that contain unique cells. (whereas I'd like only the 12th of the current month - i.e. the current date - to be highlighted)
    Moreover, this highlighting seemingly doesn't work on the metrics that contain merged cells that span over 2 weeks or over the whole month.

    From my very limited understanding something like this should at least solve the first problem:
    IF(AND(C$1=TEXT(TODAY(),"MMMM"),C$3=NUMBERVALUE(TEXT(TODAY(), "dd"))), TRUE, FALSE)
    except it doesn't work (I suspect because of merged cells).


    Please see enclosed excel sheet to get a better idea of what I'm talking about

    Thanks in advance for your help!
    Attached Files Attached Files

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,411

    Re: Apply conditional formatting to multiple cells merged on a row from a data merged row

    you have discovered why 'merged cells' are not used on any well constructed sheet that manipulates data - they should have never been implemented into Excel - their only purpose is to make the sheet look 'pretty'.
    the only cell that is active in a merged range is the upper lefthand cell.
    Torachan,

    Mission statement; Promote the use of Tables, Outlaw the use of 'merged cells' and 'RowSource'.

  3. #3
    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,173

    Re: Apply conditional formatting to multiple cells merged on a row from a data merged row

    i have had a play around today
    and if you do a few things - you may get the result you are after

    1) change the cells in row 3 - to be real dates and then format to show just the day - that will stop things like the 12 in all months being highlighted and only the actual date
    2) remove all the merged cells - you can use border formatting to show those groups if you want to , and then you can highlight the 2 weeks if a day falls between

    i have used a formula
    =IF(ISODD(WEEKNUM(TODAY(),2)),OR(WEEKNUM(TODAY(),2)-1=WEEKNUM(E$3,2),WEEKNUM(TODAY(),2)=WEEKNUM(E$3,2)),OR(WEEKNUM(TODAY(),2)=WEEKNUM(E$3,2),WEEKNUM(TODAY(),2)+1=WEEKNUM(E$3,2)))
    to do that , as conditional formatting - may not work , if the year changes over , as we sometimes get week number 53

    I have also added that formula in ROW 20 - so you can see the trues and falses - NOT NEEDED for conditional format , just a visual indication of whats going on

    Now to test different today's - I have also setup a date you can enter into B1 - to test what happens on different today() 's
    thats in ROW 16 - so you can see whats TRUE and FALSE when today() is changed using B1

    I suspect that the formula i am using can be simplified by someone more expert

    so thats a few changes you would need to make, but it will work as shown in my example attached

    I suspect you also want a month indication
    which i have not done - simply as this has been a lot of work, and your not interested in making the changes, then i have not wasted more time on a solution
    OR
    if you want things different

    i have not tested for all possible dates , as things may change when you start to implement on the real data - and the solution may not work for you , after all - anyway something for you to think about

    If you are not prepared to do those changes , then i dont know if there is a solution, maybe VBA - not my area - as mentioned before i try to avoid using merged cells whenever possible - because of these sorts of issues
    Attached Files Attached Files
    Last edited by etaf; 06-12-2022 at 12:34 PM.
    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.

+ 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] copy data from merged cells and paste to merged cells in a different layout
    By elibdis in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 07-30-2021, 06:51 AM
  2. [SOLVED] Conditional Formatting with Merged Cells
    By WaveWalker116 in forum Excel General
    Replies: 6
    Last Post: 11-22-2020, 12:13 PM
  3. [SOLVED] Conditional Formatting to Uneven Merged Cells
    By poohly in forum Excel General
    Replies: 2
    Last Post: 09-25-2020, 07:23 AM
  4. Replies: 6
    Last Post: 10-29-2015, 03:38 PM
  5. Replies: 0
    Last Post: 11-25-2014, 07:08 AM
  6. Conditional formatting in merged cells
    By davehow87 in forum Excel General
    Replies: 1
    Last Post: 08-11-2014, 04:56 AM
  7. Conditional Formatting of Merged Cells
    By ClubCrackerz in forum Excel General
    Replies: 0
    Last Post: 06-14-2012, 03:58 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