Vlookup help

GOKULA

New Member
Joined
Nov 8, 2019
Messages
8
Can anyone help me with this. One of my sheets has info on student ID and the class they were in last year. The new sheet has the student id and the class they are enrolled in this year. If they both don't match it should say bad. Sheet two should look like the table below. The range is H2:P1854, H is the ID Column, P is the class Column(for both sheets)
[TABLE="width: 500"]
<tbody>[TR]
[TD]ID
[/TD]
[TD]Class
[/TD]
[TD]Verification
[/TD]
[/TR]
[TR]
[TD]1234566
[/TD]
[TD]Math
[/TD]
[TD]
=IF(VLOOKUP(H2,'2018 Classes Roster'!$H$2:$P$1854,6,FALSE)=0,"bad","good")
[/TD]
[/TR]
[TR]
[TD]3423443
[/TD]
[TD]Math
[/TD]
[TD]Good
[/TD]
[/TR]
[TR]
[TD]3422342
[/TD]
[TD]Science
[/TD]
[TD]Bad
[/TD]
[/TR]
[TR]
[TD]8978989
[/TD]
[TD]Science
[/TD]
[TD]Bad
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
How about
=IF(VLOOKUP(H2,'2018 Classes Roster'!$H$2:$P$1854,6,FALSE)<>P2,"bad","good")
 
Upvote 0
Thanks for the fast response! When I change the class from science to math, it's still returning good.
 
Upvote 0
How about
=IF(VLOOKUP(H2,'2018 Classes Roster'!$H$2:$P$1854,9,FALSE)<>P2,"bad","good")
 
Upvote 0
How about
=IF(VLOOKUP(H2,'2018 Classes Roster'!$H$2:$P$1854,9,FALSE)<>P2,"bad","good")

i made a typo at the start, P is not the class class, M is the class column,

Do i have to select the entire table from the sheet? or can i just select the needed columns??
 
Upvote 0
You can do it like
=IF(VLOOKUP(H2,'2018 Classes Roster'!$H$2:$M$1854,6,FALSE)<>P2,"bad","good")

As long as the last row of the lookup table is row 1854 or less.
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
This the first sheet
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Student ID[/TD]
[TD]Course ID Fall[/TD]
[/TR]
[TR]
[TD]M82922929[/TD]
[TD]A&S 001[/TD]
[/TR]
[TR]
[TD]M68669689[/TD]
[TD]A&S 012[/TD]
[/TR]
[TR]
[TD]M78666687[/TD]
[TD]A&S 035[/TD]
[/TR]
[TR]
[TD]M28262728[/TD]
[TD]A&S 055[/TD]
[/TR]
</tbody>[/TABLE]

You have helped me create a formula that would identify a mismatch happening.
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Student ID[/TD]
[TD]Course ID Spring[/TD]
[TD]Status[/TD]
[/TR]
[TR]
[TD]M82922929[/TD]
[TD]A&S 001[/TD]
[TD]Good[/TD]
[/TR]
[TR]
[TD]M68669689[/TD]
[TD]A&S 013[/TD]
[TD]Bad [/TD]
[/TR]
[TR]
[TD]M78666687[/TD]
[TD]A&S 029[/TD]
[TD]Bad[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]M28262728 [/TD]
[TD]A&S 045 [/TD]
[TD]Bad [/TD]
[/TR]
</tbody>[/TABLE]

If it shows up bad, i want a formula that would look up another sheet( that looks like below). If fall course was A&S 012 and if then Spring class is A&S 013 it should return good. Similarly for the A&S 045, if the spring course id is any of the 3 in the last row and the fall id was A&S 055, it should return good.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Course ID fall[/TD]
[TD]Course ID spring[/TD]
[/TR]
[TR]
[TD]A&S 001[/TD]
[TD] A&S 001[/TD]
[/TR]
[TR]
[TD]A&S 012[/TD]
[TD] A&s 013[/TD]
[/TR]
[TR]
[TD]A&S 035[/TD]
[TD] A&S 029[/TD]
[/TR]
[TR]
[TD]A&S 055[/TD]
[TD] A&S 025, 065, 045[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
As this is now a totally different question, you will need to start a new thread, thanks.
 
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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