Lookup not returning proper value

xcel50

New Member
Joined
Mar 19, 2015
Messages
25
Hello, can some explain to me why my lookup is not working properly the table is set as

C2 has the word INF
D2 =LOOKUP(C2,F1:F4,G1:G4) 'with the word INF the result is 4 but any other word does display the correct number
F1 has the word CRI
F2 has the word MAJ
F3 has the word MIN
F4 has the word INF

G1 has the word 4
G2 has the word 3
G3 has the word 2
G4 has the word 1

Sorry guys I wish I could upload the actual sheet
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
To use LOOKUP your data must be sorted in ascending order.
Try using VLOOKUP instead.
Code:
=VLOOKUP(C2,F1:G4,2,0)
 
Upvote 0
To use LOOKUP your data must be sorted in ascending order.
Try using VLOOKUP instead.
Code:
=VLOOKUP(C2,F1:G4,2,0)

No matter what in which order I sort them it doesn't work, at the end I went with the vlookup, thanks
 
Upvote 0
You're welcome. When I sorted your column F in ascending order the LOOKUP seems to work.
Excel Workbook
CDEFG
1CRI4
2INF1INF1
3MAJ3
4MIN2
Sheet
 
Upvote 0
You're welcome. When I sorted your column F in ascending order the LOOKUP seems to work.

CDEFG
CRI
INF INF
MAJ
MIN

<colgroup><col style="width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:69px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
[TD="bgcolor: #cacaca, align: center"]1[/TD]

[TD="align: right"]4[/TD]

[TD="bgcolor: #cacaca, align: center"]2[/TD]

[TD="bgcolor: #ffff00, align: right"]1[/TD]

[TD="align: right"]1[/TD]

[TD="bgcolor: #cacaca, align: center"]3[/TD]

[TD="align: right"]3[/TD]

[TD="bgcolor: #cacaca, align: center"]4[/TD]

[TD="align: right"]2[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
D2=LOOKUP(C2,F1:F4,G1:G4)

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4

Ok, you went alphabetical, I was sorting by the number only or by the level of the alarm so critical, major, minor and informational or informational, minor, major and critical, now I feel so silly :rofl:. I will still use the vlookup as I need to keep the order as my ordinal post, but thanks for the info
 
Upvote 0

Forum statistics

Threads
1,224,833
Messages
6,181,237
Members
453,026
Latest member
cknader

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