searching corresponding input tw

Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

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

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

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.

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Quickly hide and unhide rows and columns

Use the keyboard shortcut Ctrl+9 to hide selected rows and Ctrl+0 to hide selected columns. The good thing about this shortcut is that you do not need to select entire rows or columns. For example, select B3:D3 then press Ctrl+0 to hide columns B to D.

Ctrl+Shift+9 unhides rows and Ctrl+Shift+0 unhides columns.

View all Excel hints and tips


Server loaded in 0.11 secs.