+ Reply to Thread
Results 1 to 6 of 6

Conditional Formatting Formula to Highlight Multiple Cells in Different Columns and Rows

Hybrid View

  1. #1
    Registered User
    Join Date
    11-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Conditional Formatting Formula to Highlight Multiple Cells in Different Columns and Rows

    I created a 10x10 array that serves as a multiplication table. I wanted to use conditional formatting to easily highlight all the perfect squares (e.g. 4,16,25,36...)

    Is there anyway I can do this by entering in a formula into conditional formatting? I have a basic idea of how I could do this-- =B2=POWER(SQRT(B2),2)... I am confused on how I could do this in conditional formatting formulas.

    Any ideas?

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting Formula to Highlight Multiple Cells in Different Columns and Ro

    If the array is in A1:J10 (the array that I used) Select the array and click on Conditional Formatting, New Rule, Use Formula...., and enter this formula in the formula field.

    Formula: copy to clipboard
    =OR(MOD(SQRT(A1),2)=0,MOD(SQRT(A1),2)=1)


    Select the formatting that you want to apply.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,697

    Re: Conditional Formatting Formula to Highlight Multiple Cells in Different Columns and Ro

    Quote Originally Posted by Yobish View Post
    =B2=POWER(SQRT(B2),2)...
    I think that would highlight all numbers because any number is the same as the square of it's square root, perfect square or not

    Try

    =MOD(B2^(1/2),1)=0

    although that will also format blanks so if you don't want that change to this version

    =(B2<>"")*(MOD(B2^(1/2),1)=0)
    Audere est facere

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Conditional Formatting Formula to Highlight Multiple Cells in Different Columns and Ro

    Try it. I used whole numbers only.

  5. #5
    Registered User
    Join Date
    11-07-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Conditional Formatting Formula to Highlight Multiple Cells in Different Columns and Ro

    Thank you! I had been working on it for way too long-- now I am relieved.

    case closed

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Conditional Formatting Formula to Highlight Multiple Cells in Different Columns and Ro

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. Replies: 6
    Last Post: 06-29-2013, 03:56 PM
  2. Conditional Formatting - Highlight All Rows in Table with Errors in Cells
    By jgray in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2013, 03:34 PM
  3. Replies: 0
    Last Post: 12-26-2012, 07:54 AM
  4. highlight rows / columns using VBA & Conditional Formatting problem
    By MARKSTRO in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-03-2010, 12:00 PM
  5. Replies: 0
    Last Post: 03-15-2005, 07:40 AM

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