+ Reply to Thread
Results 1 to 11 of 11

[SOLVED] * CF - format two rows based on value of 2 merged cells

  1. #1
    Registered User
    Join Date
    02-18-2007
    Posts
    26

    [SOLVED] * CF - format two rows based on value of 2 merged cells

    In attached example, range A1:I12 is grayed out because A1:A2 is blank.
    I used =ISBLANK($A$1:$A$2) and applied to A1:I12 range.

    I tried to make a "blanket rule" for all the rows in entire A1:I12, and failed, of course

    Appreciate your time ...


    Excel 2007 file
    Attached Files Attached Files
    Last edited by geopiet; 12-24-2012 at 09:13 PM. Reason: [SOLVED]

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: CF - format two rows based on value of 2 merged cells

    Use this rule instead

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    02-18-2007
    Posts
    26

    Re: CF - format two rows based on value of 2 merged cells

    Thanks for quick turnaround

    Yes, it works great in the example provided, but when I incorporated it into the real file, it stumbles a bit, mixing up the rows

    I modified the example file to resemble the actual one.
    Attached Files Attached Files

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: CF - format two rows based on value of 2 merged cells

    Can you update your sample to and after? Not quite sure I see what you are asking.
    HTH
    Regards, Jeff

  5. #5
    Registered User
    Join Date
    02-18-2007
    Posts
    26

    Re: CF - format two rows based on value of 2 merged cells

    Hi Jeff,

    I updated the original sample ( "cf-blank row.xlsx‎" from my first post) with the code supplied by Ace_XL, and it worked just fine.
    However when I tried to use it in the actual file, it doesn't work properly. It skips some rows, and/or grays out the ones it not suppose to.
    Yo can see it in the second attachment, named " cf-blank row-Ace_XL.xlsx‎" , or in this screenshot -> http://goo.gl/6D7p3

    Thank you for your time

  6. #6
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,941

    Re: CF - format two rows based on value of 2 merged cells

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

    Those merged cells in A make things difficult. The formula only looks at the odd A's for each pair of rows because Excel only uses the address of the top left cell of any merged group. I.e. A1:A2 is referenced with just A1, etc.
    Last edited by protonLeah; 12-23-2012 at 09:25 PM.
    Ben Van Johnson

  7. #7
    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
    53,048

    Re: CF - format two rows based on value of 2 merged cells

    Ben, i have been scratching my head on this 1 too. I was using the file from post #3 tho

    was also playing aroudn with mod(), but couldnt think how to get it to work, good 1
    Last edited by FDibbins; 12-23-2012 at 09:25 PM.
    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

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: CF - format two rows based on value of 2 merged cells

    in that case this should also work
    =ISBLANK(INDEX(A:A,IF(MOD(ROW(),2),ROW(),ROW()-1)))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Registered User
    Join Date
    02-18-2007
    Posts
    26

    Re: CF - format two rows based on value of 2 merged cells

    Thank you guys for taking your time with this, especially at this time of the year.

    I got excited about prontoLeah's solution. it works just as intended.
    The one from martindwilson has some kinks in it, it misbehaves


    Unfortunately, when plugged into the actual file, prontoLeah's code grays out everything, regardless if the cells are blank or not.
    See screenshot -> http://goo.gl/lZGli

    And here is screenshot of the same file, but with martindwilson's formula -> http://goo.gl/AbtyE


    Attached file "cf-blank row - prontoLeah" contains prontoLeah's formatting.

    Again, thank you everyone, and happy holidays and New Year.
    Attached Files Attached Files

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: CF - format two rows based on value of 2 merged cells

    you start in an even row so the argument needs to be reversed
    =ISBLANK(INDIRECT("c" & IF(MOD(ROW($C6),2),ROW($C6)-1,ROW($C6))))
    or
    =ISBLANK(INDEX($C:$C,IF(MOD(ROW($C6),2),ROW($C6)-1,ROW($C6))))
    edit mind you ,you can just use row()
    =ISBLANK(INDIRECT("c" & IF(MOD(ROW(),2),ROW()-1,ROW()))) =ISBLANK(INDEX($C:$C,IF(MOD(ROW(),2),ROW()-1,ROW())))
    Last edited by martindwilson; 12-24-2012 at 07:24 AM.

  11. #11
    Registered User
    Join Date
    02-18-2007
    Posts
    26

    Re: CF - format two rows based on value of 2 merged cells

    Thank you martindwilson and others,
    I used the first formula from your post. It works.
    Didn't try the others yet.

    Happy holidays and New Year

+ 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