+ Reply to Thread
Results 1 to 4 of 4

Compare 2 Columns

  1. #1
    Registered User
    Join Date
    06-08-2007
    Location
    Cardington, Ohio
    MS-Off Ver
    2010
    Posts
    11

    Compare 2 Columns

    Situation:

    I have an Excel Spreadsheet with data pulled from 2 different access databases. One column contains a Point of Sales Customer Number(PosCustomer) pulled from the Point of Sales Database, another contains the Customer Information Service Customer Number(CisCustomer) and the last one contains the Customer Information Service Account Number(CisAccount) both pulled from Customer Information Service Database

    Goal:

    If PosCustomer = CisCustomer then highlight Red
    If PosCustomer = CisAccount then highlight Blue

    Question:

    How would I do this?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Use conditional formatting.

    Assuming PosCustomer is in column A, CisCustomer is in column B, CisAccount is in column C:

    Select full range in column A and go to Format|Conditional Formatting

    Select Formula Is from 1st drop down and enter formula: =Countif(B:B,A1)
    where A1 is the top most cell in your selected range.

    Click Format and select red from the Pattern tab.

    Click Ok and then click Add

    Select formula is again and enter formula: =Countif(C:C,A1).
    where A1 is the top most cell in your selected range.

    Click Format and select blue from the Pattern tab.

    Click Ok. Click Ok again.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-08-2007
    Location
    Cardington, Ohio
    MS-Off Ver
    2010
    Posts
    11

    Thumbs up

    Thanks a ton, I was trying to do it in VBA but this is much simpler
    "If you want to know what a man's like take a good look at how he treats his inferiors not his equals"

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    You're welcome!

+ 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