+ Reply to Thread
Results 1 to 11 of 11

INDIRECT in Conditional Formatting Question

  1. #1
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    INDIRECT in Conditional Formatting Question

    Hi,

    I'm stumped as to why this doesn't work, but am sure it's something simple.

    I have conditional formatting in A3 that compares A3 to A2 and if the results are the same it changes the cell colour. - =INDIRECT("a"&ROW())=INDIRECT("A"&ROW()-1)

    I then have conditional formatting in B3 that should change the cell colour if A2 & A3 match and B2 & B3 match - =AND(INDIRECT("A"&ROW())=INDIRECT("A"&ROW()-1),INDIRECT("B"&ROW())=INDIRECT("B"&ROW()-1))

    but for some reason this second one doesn't work.

    For info, I'm using INDIRECT in this to maintain the conditional formatting as and when new rows are entered in the middle of the data.

    Any one got any bright ideas on this?
    Am I just missing some fundamental point?

    Thanks.

    S.
    If I've been of help, please hit the star

  2. #2
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: INDIRECT in Conditional Formatting Question

    For the first I'd use: =INDEX(A:A,ROW())=INDEX(A:A,ROW()-1)

  3. #3
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: INDIRECT in Conditional Formatting Question

    And this for the 2nd

    =AND(INDEX(A:A,ROW())=INDEX(A:A,ROW()-1),INDEX(B:B,ROW())=INDEX(B:B,ROW()-1))

  4. #4
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: INDIRECT in Conditional Formatting Question

    Quote Originally Posted by Cutter View Post
    For the first I'd use: =INDEX(A:A,ROW())=INDEX(A:A,ROW()-1)
    Thanks for the reply Cutter. I thought of that but the formatting will continue down the sheet so if row 4 = row 3 the conditional formatting will kick in and if row 5 = row 4 it will again, etc. etc. etc.

    Sorry, I know I should have explained that at the start.

  5. #5
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: INDIRECT in Conditional Formatting Question

    Ignore my previous reply. A combination of my first formula and your second one works wonders!

    Many thanks Cutter

  6. #6
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: INDIRECT in Conditional Formatting Question

    The formulas are working for me
    Attached Files Attached Files

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: INDIRECT in Conditional Formatting Question

    Oops, should have refreshed.

    You're welcome. Glad you got it working. I always avoid INDIRECT() whenever possible.

  8. #8
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: INDIRECT in Conditional Formatting Question

    You're a star. Can't give rep on this occasion as apparently I need to "share the love" before I can leave more for you... But I would if I could.

  9. #9
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: INDIRECT in Conditional Formatting Question

    Hmmm, that's weird. Is it because I was the last person you repped?

    Anyway, it's the thought that counts. Thanks.

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: INDIRECT in Conditional Formatting Question

    Ahh, I see you repped me on Jun 17. Maybe there's a time limit. Or you can't rep the same person consecutively. Dunno.

  11. #11
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: INDIRECT in Conditional Formatting Question

    I think so. I'm usually trying to answer questions rather than pose questions so don't have much call to rep people. I shall remember that I owe you some and will add when I can

+ 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