+ Reply to Thread
Results 1 to 17 of 17

Conditional formating-how I could accomplish that?

  1. #1
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    Conditional formating-how I could accomplish that?

    Hello everyone.

    I am trying to check if to columns in a table have the same values. If they are not all the same, a remote cell that is not part of the table should turn red. I tried "=NOT(A1:A99=B1:B99)" that works good as a true and false comparison but doesn't work for the conditional formating...

    I am comfortable using formulas for conditional formating but this one seems to be tricker than I thought

    Anyone has any idea how I could accomplish that?

    Thanks

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

    re: Conditional formating-how I could accomplish that?

    =A1:A99=B1:B99 only compares
    a1 to b1 if in row a1
    a2 to b2 if in row 2
    "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

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

    re: Conditional formating-how I could accomplish that?

    Give this a try

    =SUMPRODUCT(--($A$1:$A$99<>$B$1:$B$99))

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

    re: Conditional formating-how I could accomplish that?

    i was going to suggest
    =NOT(SUMPRODUCT(--(A1:A10=B1:B10))=10) but this assumes you are comparing a1-b1
    a2-b2 and so on

  5. #5
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    re: Conditional formating-how I could accomplish that?

    =A1:A99=B1:B99 only compares
    a1 to b1 if in row a1
    a2 to b2 if in row 2
    Thanks for the reply. That is exactly what I want. I want every row in these to columns to have the same value, and works fine if I paste the formula in a cell, but not when used as a formula for conditional formating...
    Last edited by mhhenn; 05-04-2011 at 08:46 PM.

  6. #6
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    re: Conditional formating-how I could accomplish that?

    Quote Originally Posted by Cutter View Post
    Give this a try

    =SUMPRODUCT(--($A$1:$A$99<>$B$1:$B$99))
    Thanks Cutter. I just changed the formula to be False/True and it worked!

    =SUMPRODUCT(--($A$1:$A$99<>$B$1:$B$9))>0

    Thanks for the quickly reply.

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

    re: Conditional formating-how I could accomplish that?

    I used the formula I gave you in CF and it works just fine.

  8. #8
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    re: Conditional formating-how I could accomplish that?

    I used the formula I gave you in CF and it works just fine.
    Sorry you are perfectly right. Your formula works just as it should.

    On question if you still have the time. What the "--" in =SUMPRODUCT(--($A$1:$A$99<>$B$1:$B$9)) are for?

    Thanks

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

    re: Conditional formating-how I could accomplish that?

    That is called double unary. It converts TRUE / FALSE values to numeric values 1 / 0.

  10. #10
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    re: Conditional formating-how I could accomplish that?

    Quote Originally Posted by Cutter View Post
    That is called double unary. It converts TRUE / FALSE values to numeric values 1 / 0.
    Thank you, that was a first.

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

    re: Conditional formating-how I could accomplish that?

    Thanks for the reply. That is exactly what I want. I want every row in these to columns to have the same value, and works fine if I paste the formula in a cell, but not when used as a formula for conditional formating...
    that formula isnt working fine! it is exactly the same as =a1=b1 dragged down 99 rows so 99 seperate conditional formats would be needed one for each cell

  12. #12
    Registered User
    Join Date
    08-07-2010
    Location
    London,England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Cool Using Vlookup for duplicated numbers

    Hi everyone,

    I am trying to vlookup the numbers in column titled branch to return same for cif but excel is returning the first cif number where the branch numbers are duplicated as follows:

    Branch Cif Excel Results (Cif)
    304620 308203 308203
    304620 308055 308203
    304620 306207 308203
    452546 228901 228901
    305552 302398 302398
    305552 181381 302398
    305239 306863 306863

    Please what logical formulas can i use to get around this lack of unique numbers.

    Many thanks for you assistance.

    Folarin

  13. #13
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    re: Conditional formating-how I could accomplish that?

    Quote Originally Posted by martindwilson View Post
    that formula isnt working fine! it is exactly the same as =a1=b1 dragged down 99 rows so 99 seperate conditional formats would be needed one for each cell
    It does work. Not by checking if each row has the same value on both columns but by comparing the final result in both columns and checking if they are the same. As soon as the numbers are very unique and not 1 digit units it will be VERY difficult to get a fake TRUE because some numbers were mixed up.

  14. #14
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Using Vlookup for duplicated numbers

    Quote Originally Posted by fodejimi View Post
    Hi everyone,

    I am trying to vlookup the numbers in column titled branch to return same for cif but excel is returning the first cif number where the branch numbers are duplicated as follows:

    Branch Cif Excel Results (Cif)
    304620 308203 308203
    304620 308055 308203
    304620 306207 308203
    452546 228901 228901
    305552 302398 302398
    305552 181381 302398
    305239 306863 306863

    Please what logical formulas can i use to get around this lack of unique numbers.

    Many thanks for you assistance.

    Folarin
    You are in the wrong thread but if you do something like the example below it will work.

    # Branch Cif Excel Results (Cif)
    1 304620 308203 308203
    2 304620 308055 308203
    3 304620 306207 308203
    4 452546 228901 228901
    5 305552 302398 302398
    6 305552 181381 302398
    7 305239 306863 306863

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

    re: Conditional formating-how I could accomplish that?

    nope a1:a99=b1:b99 does not work how you think see attached
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    04-21-2011
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    10

    re: Conditional formating-how I could accomplish that?

    Quote Originally Posted by martindwilson View Post
    nope a1:a99=b1:b99 does not work how you think see attached
    It happened a misunderstanding. I was referring to =SUMPRODUCT(--($A$1:$A$99<>$B$1:$B$9)) when I said it look all at once. a1:a99=b1:b99 and a1=b1 I agree that they do exactly the same thing.

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

    re: Conditional formating-how I could accomplish that?

    @mhhenn
    This is solved, isn't it?
    If so, please mark your thread as SOLVED (click on the FAQ link at top of page for directions if needed).

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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