ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   lookup (https://www.excelbanter.com/excel-discussion-misc-queries/41517-lookup.html)

paulh

lookup
 
sheet 1
type in to sheet1 d6 (15gr) refer to sheet2 and result in f8 sheet1 to be 3.5
or type in 10gr into d6 sheet 1 and result in f8 sheet 1 to be 2.7

Sheet2
A B
10GR 2.7
15GR 3.5
20GR 5.6


Melissa

In F8:
vlookup(D6,Sheet2!$A$1:$b$3,2,false)

"paulh" wrote:

sheet 1
type in to sheet1 d6 (15gr) refer to sheet2 and result in f8 sheet1 to be 3.5
or type in 10gr into d6 sheet 1 and result in f8 sheet 1 to be 2.7

Sheet2
A B
10GR 2.7
15GR 3.5
20GR 5.6


Max

Sheet2 houses the reference table in cols A & B as indicated, assumed from
row1

In Sheet1,

Put in F8:
=IF(ISNA(MATCH(D6,Sheet2!A:A,0)),"",VLOOKUP(TRIM(D 6),Sheet2!A:B,2,0))

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"paulh" wrote in message
...
sheet 1
type in to sheet1 d6 (15gr) refer to sheet2 and result in f8 sheet1 to be

3.5
or type in 10gr into d6 sheet 1 and result in f8 sheet 1 to be 2.7

Sheet2
A B
10GR 2.7
15GR 3.5
20GR 5.6




Melissa

Sorry, there should be quotations around Sheet2, i.e.
=vlookup(D6,'Sheet2'!$A$1:$B$3,2,false)

"Melissa" wrote:

In F8:
vlookup(D6,Sheet2!$A$1:$b$3,2,false)

"paulh" wrote:

sheet 1
type in to sheet1 d6 (15gr) refer to sheet2 and result in f8 sheet1 to be 3.5
or type in 10gr into d6 sheet 1 and result in f8 sheet 1 to be 2.7

Sheet2
A B
10GR 2.7
15GR 3.5
20GR 5.6


Biff

If you're "Trimming" the lookup shouldn't you do the same for the match ?

Biff

"Max" wrote in message
...
Sheet2 houses the reference table in cols A & B as indicated, assumed from
row1

In Sheet1,

Put in F8:
=IF(ISNA(MATCH(D6,Sheet2!A:A,0)),"",VLOOKUP(TRIM(D 6),Sheet2!A:B,2,0))

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"paulh" wrote in message
...
sheet 1
type in to sheet1 d6 (15gr) refer to sheet2 and result in f8 sheet1 to be

3.5
or type in 10gr into d6 sheet 1 and result in f8 sheet 1 to be 2.7

Sheet2
A B
10GR 2.7
15GR 3.5
20GR 5.6






Max

"Biff" wrote
If you're "Trimming" the lookup
shouldn't you do the same for the match ?


Yes, of course, for consistency of treatment.
Thanks for the correction.

To the OP:

In Sheet1,
Put instead in F8:
=IF(ISNA(MATCH(TRIM(D6),Sheet2!A:A,0)),"",VLOOKUP( TRIM(D6),Sheet2!A:B,2,0))

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--



Biff

Hi!

the quotes are only needed if the sheet name contains a space:

='Sheet 2'!A1

OR, if you are including the file name and file path:

='C:\mydir\[myfile.xla]sheet2'!A1

Biff

"Melissa" wrote in message
...
Sorry, there should be quotations around Sheet2, i.e.
=vlookup(D6,'Sheet2'!$A$1:$B$3,2,false)

"Melissa" wrote:

In F8:
vlookup(D6,Sheet2!$A$1:$b$3,2,false)

"paulh" wrote:

sheet 1
type in to sheet1 d6 (15gr) refer to sheet2 and result in f8 sheet1 to
be 3.5
or type in 10gr into d6 sheet 1 and result in f8 sheet 1 to be 2.7

Sheet2
A B
10GR 2.7
15GR 3.5
20GR 5.6





All times are GMT +1. The time now is 06:01 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com