#1   Report Post  
johnny
 
Posts: n/a
Default Compare cells

Using Excell 2003.
I have 7 cells in a row each with a different number in each cell.
Selecting the first cell I wish to compare the number against a column
consisting of 21 numbers.
If the number in the selected cell is the same as a number in the column I
want to select that cell background colour yellow.
If the number in the selected cell does not correspond with a number in the
column then move to the next cell on the row and repeat until all 7 cells on
the row have been checked.
Have tried various ways but am stuck.
Can anyone help?
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

Select the seven cells, go to Format Conditional
Formatting, select "Formula Is" and put:

=COUNTIF($I$1:$I$21,INDIRECT("rc",0))

Press the Format radio button and format as desired.

To copy the CF to additional rows, select the seven
cells, click on the paintbrush icon, and select the rows.

Change the range if necessary.

HTH
Jason
Atlanta, GA

-----Original Message-----
Using Excell 2003.
I have 7 cells in a row each with a different number in

each cell.
Selecting the first cell I wish to compare the number

against a column
consisting of 21 numbers.
If the number in the selected cell is the same as a

number in the column I
want to select that cell background colour yellow.
If the number in the selected cell does not correspond

with a number in the
column then move to the next cell on the row and repeat

until all 7 cells on
the row have been checked.
Have tried various ways but am stuck.
Can anyone help?
.

  #3   Report Post  
Duke Carey
 
Posts: n/a
Default

Use Conditional formatting, using this formula -

=MATCH(a1,Validate,0)0

which assumes cell A1 is active when you call up the conditional formatting
menu, and also assumes that you name the range of 21 numbers 'Validate'

Duke

"johnny" wrote:

Using Excell 2003.
I have 7 cells in a row each with a different number in each cell.
Selecting the first cell I wish to compare the number against a column
consisting of 21 numbers.
If the number in the selected cell is the same as a number in the column I
want to select that cell background colour yellow.
If the number in the selected cell does not correspond with a number in the
column then move to the next cell on the row and repeat until all 7 cells on
the row have been checked.
Have tried various ways but am stuck.
Can anyone help?

  #4   Report Post  
Trevor Shuttleworth
 
Posts: n/a
Default

Johnny

look at Conditional Formatting.

Assuming the cells you want to check are in row 1 and the cells you want to
check them against are in rows 2 to 22 below, first select cells A1 to G1,
that is, all 7 cells.

Then, from the menu, select Format | Conditional Formatting...

Set the Condition to Formula is: =COUNTIF(A$2:A$22,A$1) and choose
some appropriate formatting, for example, yellow background (patterns |
colour = yellow)

If it is the same column of numbers for all the cells, then change A$2:A$22
to $A$2:$A$22 ... adjust the column and rows to meet your needs.

Regards

Trevor



"johnny" wrote in message
...
Using Excell 2003.
I have 7 cells in a row each with a different number in each cell.
Selecting the first cell I wish to compare the number against a column
consisting of 21 numbers.
If the number in the selected cell is the same as a number in the column I
want to select that cell background colour yellow.
If the number in the selected cell does not correspond with a number in
the
column then move to the next cell on the row and repeat until all 7 cells
on
the row have been checked.
Have tried various ways but am stuck.
Can anyone help?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I compare data in two worksheets to find matching cells? Gary Excel Discussion (Misc queries) 4 March 2nd 06 09:04 PM
How do you compare text in cells Sam Excel Worksheet Functions 1 February 18th 05 05:16 PM
How do I compare cells in a column Jim K New Users to Excel 2 January 29th 05 11:59 PM
To safety merge cells without data destroyed, and smart unmerge! Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:17 AM
Heps to design Locked/Unlocked cells in protected worksheet Kevin Excel Discussion (Misc queries) 0 December 30th 04 07:09 AM


All times are GMT +1. The time now is 11:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"