Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I am trying to cross reference two excel spreadsheets. I want account numbers from one worksheet to be checked against another worksheet, then if the exact number is found then either the row or cell to be highlighted or shown as the value in the first worksheet. Can anyone help??? Kal

if the first sheet contains the correct infos, maybe use a vlookup to make the 2nd sheet value regardin to it's brother in 1st sheet.
Neither use a pivot table made of the 2 sheets.

Excel, Help, Contents and Index, vlookup provides a good explanation and provides examples of how the formula is used.
Another short method is to click on the fx button in the toolbar.
Click on "All" in the left hand pane and VLOOKUP in the right hand pane.It will show you the formula syntax and an explanation of the different parameters of the formula.
In the top portion of the dialog box there are four parameters of the formula.
The first is the range of cells in your first sheet that contains your Account numbers.
(use (click on) the little picture on the far right side of the input box to define your range by clicking and dragging the cell range)The second input box is for your table array which is the range of cells that includes your account numbers and as many adjacent cells on your second sheet.
The third is the value that you want to return to the first sheet from the second sheet defined by the amount of columns to the right of the account numbers on the second sheet.
Let's say that on your second sheet you have your account numbers in column A and in column B it contains the word "Yes" all the way down the column and that is the value you want to return.The forth box, to make it simple, just input "false" without the quotation marks.
In the above example we will say that the range goes from A1:A10 so your formula would be:
In B1 =VLOOKUP($A$1:$A$10,Sheet2!$A$1:$B$10,2,FALSE)
If the value you wanted to return was like YTD sales and that was in column M then the array in sheet2 must include the 12 columns and the "2" in the above formula would be "12".After you click and drag using the picture thingy the range will show as A1:A10 but while it is still there hit the F4 key once and it will add the $ symbol to the formula that you need. (I won't explain that now)
After filling in the four boxes hit Ok and the formula will return either "Yes" or #N/A in B1.
Move the cursor over the bottom right hand corner of cell B1 so the cursor pointer changes to a black crosshair cursor and then doubleclick on it to automatically drag the formula (called Fill down)The result will show you which account numbers on sheet 1 have a matching account number on sheet 2.
Another option would be to enter the following formula in B1:
=COUNTIF(Sheet2!$A$1:$A$10,A1)
and drag it down (or use Fill Down method)
This says Count if the values in sheet 2, column A match the value in A1 of sheet 1.
When you drag it down the A1 will change to A2, A3...
In the B column you will see a "1" if that account number is also in column A on sheet 2 otherwise it will show a "0".Use Excel Help. it is pretty good once you get used to it.
HTH
Bryan

It's too bad they don't come back to find the answers.
Happens a lot on this board.Coincidentally, it took over 1/2 hour to put that together and when I got to the part where I was about to type "HTH Bryan" I had a power failure (3 quick ones). It was not enough to reset my digital clocks in the house but it was enough to restart this PC so I had to type it all a second time.
Go figure.I would like to know half of what you know about macros though. I am still in Macro first grade.
Regards,
Bryan

![]() |
Changing the Home Page of...
|
outlook signature xp netw...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |