VLOOKUP/IF Help!! Please Help!

JROGER30

New Member
Joined
Nov 25, 2009
Messages
1
I'm building a sheet that will allow me to enter an employee's ID number and subsequently return some columns of data that I need to see. The data that I want to be returned will be contained in 2 different sheets within the same workbook and the data in these sheets is updated automatically via an access database query and a macro to make the data refresh upon opening. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
<o:p></o:p>
I’ve got the queries running smoothly and the data is all there. The only problem is that one of the sheets that I need to pull data from will inevitably contain duplicate data in the column that will contain the lookup values, causing the VLOOKUP function to not work. <o:p></o:p>
<o:p></o:p>
Sheet 1 – Input (here is where I’ll type in the employee ID and populate info)<o:p></o:p>
Sheet 2 – Employee record data (this will return data needed to identify)<o:p></o:p>
Sheet 3 – Employee action database (this is my problem)<o:p></o:p>
<o:p></o:p>
When I enter an employee ID into “sheet 1”, I just need a column to say “YES” if that ID is contained within “sheet 3” and a “No” if it is not.<o:p></o:p>
<o:p></o:p>
I CANNOT FIGURE THIS OUT!<o:p></o:p>
<o:p></o:p>
PLEASE HELP! J<o:p></o:p>
<o:p></o:p>
Example:<o:p></o:p>
<o:p></o:p>
<TABLE class=MsoNormalTable style="MARGIN: auto auto auto 4.55pt; WIDTH: 54.85pt; BORDER-COLLAPSE: collapse; mso-padding-alt: 0in 5.4pt 0in 5.4pt" cellSpacing=0 cellPadding=0 width=73 border=0><TBODY><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 0; mso-yfti-firstrow: yes"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: silver 1pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: maroon; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; mso-border-top-alt: solid silver .5pt; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt" vAlign=bottom width=73>Sign On<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 1"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: silver 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-alt: solid silver .5pt" vAlign=bottom width=73>21124<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 2"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21124<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 3"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21124<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 4"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21236<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 5"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21236<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 6"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>20792<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 7"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>20792<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 8"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>20792<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 9"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21209<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 10"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21209<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 11"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21209<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 12"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21209<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 13"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21216<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 14"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21216<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 15"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21329<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 16"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21329<o:p></o:p>

</TD></TR><TR style="HEIGHT: 12.75pt; mso-yfti-irow: 17; mso-yfti-lastrow: yes"><TD style="BORDER-RIGHT: silver 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #e0dfe3; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: silver 1pt solid; WIDTH: 54.85pt; PADDING-TOP: 0in; BORDER-BOTTOM: silver 1pt solid; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid silver .5pt; mso-border-right-alt: solid silver .5pt; mso-border-bottom-alt: solid silver .5pt" vAlign=bottom width=73>21264<o:p></o:p>

</TD></TR></TBODY></TABLE>
<o:p></o:p>
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
For this you could even just use an if statement we will say the id you want to look up is in Sheet1 cell A1, and that in Sheet2 the id lists are in column A, you would have to use a formula similar to this in column B in sheet1:

=IF($A1,'Sheet2'!$A:$A,"Yes","No")

All this is saying is if whats in A1 in current sheet matches a value within row A of Sheet2 then give me a yes else give me a no

Or you can use a Vlookup similar to this:

=VLOOKUP($A1,'Sheet2'!$A:$B,2,0)

$A1 = what you want to find
$A:$B = Where you want to look
2 = What column to pull the data from
0 = If true (so only if match is found, other wise you will see #N/A)
 
Upvote 0

Forum statistics

Threads
1,213,560
Messages
6,114,309
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top