searching corresponding input tw
The UK's Number 1 for Microsoft Office Training Add this page to your favourites/bookmarksBookmark page
 
View printable version of pagePrintable version
Plus One Google
Customer: Sign in
Delegate: Sign in
Trainer: Log in

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Searching for corresponding input in two (or more) columns

Searching for corresponding input in two (or more) columns

resolvedResolved · Low Priority · Version 2003

replyReply Fri 7 Aug 2009, 16:21Delegate Lisa said...

Lisa has attended:
Excel Intermediate course

Searching for corresponding input in two (or more) columns

Hi,

I was on the intermediate course last week, and have come accross a problem which I think could probably be solved using excel.

We currently have a spreadsheet which contains several columns of data. We need to make sure that for every row, if there is a 'B' in column C, this should correspond to an 'S' in colum J.

Is there a feature in Excel which would highlight any rows where this is not the case?

Thank you in anticipation.

Best wishes
Lisa Baum

For upcoming training course dates see: Pricing & availability

replyReply Sat 8 Aug 2009, 13:44Trainer Rich said...

RE: Searching for corresponding input in two (or more) columns

Hi Lisa,

You could use Conditional Formatting.

This is the formula:
=IF(AND(($C1="B"),($J1<>"S")),TRUE,FALSE)

Now click on cell A1. Go to Format menu -> Conditional Formatting. Under 'Condition 1' section, change the dropbox containing 'Cell Value Is' to 'Formula Is'. Now paste the formula above.

What this is saying is if cell C1 is equal to B and cell J1 is not equal to S, then return 'true' (in other words, DO colour this cell).

Then click on the 'Format...' button and select your desired formatting (eg. red background, see Patterns tab). Press OK when done. Then OK to close the Conditional Formatting box.

Now you need to copy the formatting (includes conditional formatting) to all the other cells. Do this by first ensuring cell A1 is still selected. Press the 'Format Painter' button on your toolbar (see attached screenshot of this if you're not sure). Cell Cell A1's border should now be flashing to indicate you have copied something from it. Now highlight the whole of row 1 only. The formatting will be applied.

Now select all of row 1, and press the 'Format Painter' button again. The whole row should have a flashing border. Now, with the mouse highlight the remaining rows in your spreadsheet.

The formula is updated for each row you copy. Because you used a dollar sign before the C and J, Excel remembers the column, but updates each row automatically.

See attached spreadsheet for a working example. (to see conditional formatting on a cell, select it and go back to Format -> Conditional Formatting).

Any questions, please ask.

Hope this helps. If this is what you're after, please mark this question as resolved.

Regards, Rich

Attached files...

format-painter-screenshot.gif
highlight-b-s.xls

Mon 17 Aug 2009: Automatically marked as resolved.

 

Please browse our web site to find out more about
excel consulting and other Microsoft training courses.

Excel tip:

The dual nature of toolbar buttons

Many toolbar buttons are dual purpose, though the two purposes are often linked in some way. For example, Align Left aligns a cell's contents to the left of the cell. However, hold down Shift and press the Align Left button: Excel aligns the cell contents to the right.
You may respond: So what? Well, you can reduce the number of buttons on your toolbar to make your screen less cluttered and allow more room for, perhaps, some of your own commands. After all, what's the point of an Align Right button when Shift+Align Left does the same thing?

View all Excel hints and tips


Microsoft Certified Partner Accredited Training Provider: Institute of IT Training Institute of Leadership and Management - Certified Courses Security Seal verified by visa, mastercard securecard