Help, Vlookup not working correctly

EmmaN

New Member
Joined
Jun 17, 2014
Messages
21
Hi all, I'm having problems with a vlookup formula, I am trying to return a grade in column J using the value in column J. My formula keeps returning the last line from my lookup table (H20 = z), it should be pulling an F as the value is 31.

I have tried a Vlookup and an IF function. Both return the same incorrect value from the last line of my lookup table (z). Any suggestions greatfully recieved.

An example of the data i have is as follows:

[TABLE="width: 630"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D
[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD="colspan: 2"]I
[/TD]
[TD]J
[/TD]
[TD]K
[/TD]
[TD]L
[/TD]
[TD]M
[/TD]
[TD]N
[/TD]
[TD]O
[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD]IGCSE English Lit 2016-18
[/TD]
[TD]Gender
[/TD]
[TD]Set
[/TD]
[TD]Teacher
[/TD]
[TD]Poetry Coursework
[/TD]
[TD]Poetry Weighted
[/TD]
[TD]Drama
[/TD]
[TD]Prose
[/TD]
[TD="colspan: 2"]Mock Total
[/TD]
[TD]Literature Total
[/TD]
[TD]Grade
[/TD]
[TD]OCT REPORT OTF
[/TD]
[TD]Lit target
[/TD]
[TD]MPGRADE
[/TD]
[TD]MTGRADE
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD="colspan: 2"]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD="align: center"]3
[/TD]
[TD="align: center"]Candidate A
[/TD]
[TD="align: center"]F
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]JL
[/TD]
[TD="align: center"]23
[/TD]
[TD="align: center"]31
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="colspan: 2, align: center"]0
[/TD]
[TD="align: center"]31
[/TD]
[TD="align: center"]z
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]A*
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]4
[/TD]
[TD="align: center"]Candidate B
[/TD]
[TD="align: center"]F
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]JL
[/TD]
[TD="align: center"]24
[/TD]
[TD="align: center"]32
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="colspan: 2, align: center"]0
[/TD]
[TD="align: center"]32
[/TD]
[TD="align: center"]z
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]A*
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]5
[/TD]
[TD="align: center"]Candidate C
[/TD]
[TD="align: center"]F
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]JL
[/TD]
[TD="align: center"]23
[/TD]
[TD="align: center"]31
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="colspan: 2, align: center"]0
[/TD]
[TD="align: center"]31
[/TD]
[TD="align: center"]z
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]A*
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD="align: center"]6
[/TD]
[TD="align: center"]Candidate D
[/TD]
[TD="align: center"]F
[/TD]
[TD="align: center"]1
[/TD]
[TD="align: center"]JL
[/TD]
[TD="align: center"]24
[/TD]
[TD="align: center"]32
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[TD="colspan: 2, align: center"]0
[/TD]
[TD="align: center"]32
[/TD]
[TD="align: center"]z
[/TD]
[TD="align: center"]A
[/TD]
[TD="align: center"]A*
[/TD]
[TD="align: center"]
[/TD]
[TD="align: center"]
[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD="colspan: 2"]Lookup table. 'Data' Sheet
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD="colspan: 3"]Lit
[/TD]
[TD][/TD]
[TD="colspan: 5"]=IF(J3=0,"",VLOOKUP(J3,Data!$F$3:$H$20,3,TRUE))
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]U
[/TD]
[TD][/TD]
[TD="colspan: 5"]=VLOOKUP(J3,Data!$F$3:$H$20,3,TRUE))
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD]0.17
[/TD]
[TD]17
[/TD]
[TD]U
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD]0.18
[/TD]
[TD]18
[/TD]
[TD]G
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD]0.24
[/TD]
[TD]24
[/TD]
[TD]G
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD]0.25
[/TD]
[TD]25
[/TD]
[TD]F
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD]0.32
[/TD]
[TD]32
[/TD]
[TD]F
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD]0.33
[/TD]
[TD]33
[/TD]
[TD]E
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]10
[/TD]
[TD]0.4
[/TD]
[TD]40
[/TD]
[TD]E
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]11
[/TD]
[TD]0.41
[/TD]
[TD]41
[/TD]
[TD]D
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]12
[/TD]
[TD]0.48
[/TD]
[TD]48
[/TD]
[TD]D
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]13
[/TD]
[TD]0.49
[/TD]
[TD]49
[/TD]
[TD]C
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]14
[/TD]
[TD]0.57
[/TD]
[TD]57
[/TD]
[TD]C
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]15
[/TD]
[TD]0.58
[/TD]
[TD]58
[/TD]
[TD]B
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]16
[/TD]
[TD]0.67
[/TD]
[TD]67
[/TD]
[TD]B
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]17
[/TD]
[TD]0.68
[/TD]
[TD]68
[/TD]
[TD]A
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]18
[/TD]
[TD]0.77
[/TD]
[TD]77
[/TD]
[TD]A
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]19
[/TD]
[TD]0.78
[/TD]
[TD]78
[/TD]
[TD]z
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]20
[/TD]
[TD]1
[/TD]
[TD]100
[/TD]
[TD]z
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="colspan: 2"][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Thank you. Emma
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Try
Code:
[COLOR=#333333]=VLOOKUP(J3,Data!$G$3:$H$20,2,TRUE))[/COLOR]

This will look for the Column J value in Column G (notice I changed the look table array to start with $G$3) and then retrieve the Letter Grade in column H (I also changed the third parameter to 2).
 
Upvote 0
Try
Code:
[COLOR=#333333]=VLOOKUP(J3,Data!$G$3:$H$20,2,TRUE))[/COLOR]

This will look for the Column J value in Column G (notice I changed the look table array to start with $G$3) and then retrieve the Letter Grade in column H (I also changed the third parameter to 2).


THANK YOU SO MUCH!!! This was driving me round the bend. Emma
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,100
Members
452,379
Latest member
IainTru

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