Case Sensitive Lookup

D

danpt

How do I make Range("A6") to return 97, as given in the sub.

Sub CaseSensitiveLookup()
Range("A1") = "a"
Range("B1") = "A"
Range("A2") = "97"
Range("B2") = "65"
Range("A5") = "a"
Range("A6") = "=LOOKUP(A5,$A$1:$B$1,$A$2:$B$2)" 'needs correction
End Sub
 
J

Jacob Skaria

In A6

=INDEX(A2:B2,MATCH(TRUE,EXACT(A5,A1:B1),0))

Please note that this is an array formula. Within the cell in edit mode (F2)
paste this formula and press Ctrl+Shift+Enter to apply this formula. If
successful in the Formula Bar you can notice the curly braces at both ends
"{=<formula>}"

If this post helps click Yes
 
J

Jacob Skaria

In A6

=INDEX(A2:B2,MATCH(TRUE,EXACT(A5,A1:B1),0))

Please note that this is an array formula. Within the cell in edit mode (F2)
paste this formula and press Ctrl+Shift+Enter to apply this formula. If
successful in the Formula Bar you can notice the curly braces at both ends
"{=<formula>}"

If this post helps click Yes
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Lookup and count in the same formula 1
Formatting mark 2 1
How to transfer a range from sheet to sheet? 4
Colorising cells from code 4
V/HLookup 3
grouping with vba 1
VBA calculate avg dates 1
sumif 9

Top