ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Finding an item in a list & returning a specific value (https://www.excelbanter.com/excel-worksheet-functions/227942-finding-item-list-returning-specific-value.html)

SBW

Finding an item in a list & returning a specific value
 
Is there a function I can use to ....

- Check if Sheet 1 L1 value is listed anywhere in Sheet 2 Col A. If true,
then return the corresponding value from Sheet 2 Col B into the corresponding
cell in Sheet 1 Col M.

Sheet 1:
A....K L M
1 Part 1
2 Part 2
3 Part 3 4/16/2009

Sheet 2:
A B
1 Part 3 4/16/2009
2 Part 4
3 Part 5 4/17/2009




Mike H

Finding an item in a list & returning a specific value
 
Hi,

Put this in M1 on Sheet 1 and drag down as required. If your returning dates
the column will need to be formatted as date

=IF(COUNTIF(Sheet2!A1:A200,L1)0,VLOOKUP(L1,Sheet2 !A1:B200,2,FALSE),"")

Mike

"SBW" wrote:

Is there a function I can use to ....

- Check if Sheet 1 L1 value is listed anywhere in Sheet 2 Col A. If true,
then return the corresponding value from Sheet 2 Col B into the corresponding
cell in Sheet 1 Col M.

Sheet 1:
A....K L M
1 Part 1
2 Part 2
3 Part 3 4/16/2009

Sheet 2:
A B
1 Part 3 4/16/2009
2 Part 4
3 Part 5 4/17/2009




Teethless mama

Finding an item in a list & returning a specific value
 
=IF(ISNA(VLOOKUP(L1,Sheet2!$A$1:$B$3,2,0)),"",VLOO KUP(L1,Sheet2!$A$1:$B$3,2,0))


"SBW" wrote:

Is there a function I can use to ....

- Check if Sheet 1 L1 value is listed anywhere in Sheet 2 Col A. If true,
then return the corresponding value from Sheet 2 Col B into the corresponding
cell in Sheet 1 Col M.

Sheet 1:
A....K L M
1 Part 1
2 Part 2
3 Part 3 4/16/2009

Sheet 2:
A B
1 Part 3 4/16/2009
2 Part 4
3 Part 5 4/17/2009




klswvu[_2_]

Finding an item in a list & returning a specific value
 
=INDEX(Sheet2!$A$1:$B$16,MATCH(L1,Sheet2!$A$1:$A$1 6,0),2)

Returns #N/A if part not found... use the standard ISERROR and IF around the
formula.

Jarek Kujawa[_2_]

Finding an item in a list & returning a specific value
 
=OFFSET(Sheet2!$B$1,MATCH(Sheet1!L1,Sheet2!$A$1:$A $200,)-1,)


On 16 Kwi, 21:24, SBW wrote:
Is there a function I can use to ....

- Check if Sheet 1 L1 value is listed anywhere in Sheet 2 Col A. *If true,
then return the corresponding value from Sheet 2 Col B into the corresponding
cell in Sheet 1 Col M.

Sheet 1:
* * * * * A....K * * * * * * *L * * * * * * M
1 * * * * * * * * * * * * Part 1 * * * * *
2 * * * * * * * * * * * * Part 2 * * * * *
3 * * * * * * * * * * * * Part 3 * * * * 4/16/2009

Sheet 2:
* * * * *A * * * * * * * *B
1 * *Part 3 * * * * *4/16/2009
2 * *Part 4 * * * * *
3 * *Part 5 * * * * *4/17/2009



T. Valko

Finding an item in a list & returning a specific value
 
If the value to be returned is a date and the part will only appear once:

=SUMIF(Sheet2!A1:A100,L1,Sheet2!B1:B100)

Format as Date

A result of 0 means either the part is not present or the part is present
but there is no date for that part.

--
Biff
Microsoft Excel MVP


"SBW" wrote in message
...
Is there a function I can use to ....

- Check if Sheet 1 L1 value is listed anywhere in Sheet 2 Col A. If true,
then return the corresponding value from Sheet 2 Col B into the
corresponding
cell in Sheet 1 Col M.

Sheet 1:
A....K L M
1 Part 1
2 Part 2
3 Part 3 4/16/2009

Sheet 2:
A B
1 Part 3 4/16/2009
2 Part 4
3 Part 5 4/17/2009






SBW

Finding an item in a list & returning a specific value
 
Hi,

Thank you for the solution.

The only issue I am having is the returned value is either a date, N/A or a
blank field. For a returned N/A value, when I look-up (utilize 'Find') the
part number in Sheet B and then return to Sheet A, the correct date value
then appears in Sheet A for the correct part number. Any idea why the
calculation appears to break from time to time?

This also occurs in the solution Teethless mama provided.

"Mike H" wrote:

Hi,

Put this in M1 on Sheet 1 and drag down as required. If your returning dates
the column will need to be formatted as date

=IF(COUNTIF(Sheet2!A1:A200,L1)0,VLOOKUP(L1,Sheet2 !A1:B200,2,FALSE),"")

Mike

"SBW" wrote:

Is there a function I can use to ....

- Check if Sheet 1 L1 value is listed anywhere in Sheet 2 Col A. If true,
then return the corresponding value from Sheet 2 Col B into the corresponding
cell in Sheet 1 Col M.

Sheet 1:
A....K L M
1 Part 1
2 Part 2
3 Part 3 4/16/2009

Sheet 2:
A B
1 Part 3 4/16/2009
2 Part 4
3 Part 5 4/17/2009




SBW

Finding an item in a list & returning a specific value
 
Hi,

Thank you for the solution.

The only issue I am having is the returned value is either a date, N/A or a
blank field. For a returned N/A value, when I look-up (utilize 'Find') the
part number in Sheet B and then return to Sheet A, the correct date value
then appears in Sheet A for the correct part number. Any idea why the
calculation appears to break from time to time?

This also occurs with the solution Mike H provided. I sent the same reply to
Mike H.


"Teethless mama" wrote:

=IF(ISNA(VLOOKUP(L1,Sheet2!$A$1:$B$3,2,0)),"",VLOO KUP(L1,Sheet2!$A$1:$B$3,2,0))


"SBW" wrote:

Is there a function I can use to ....

- Check if Sheet 1 L1 value is listed anywhere in Sheet 2 Col A. If true,
then return the corresponding value from Sheet 2 Col B into the corresponding
cell in Sheet 1 Col M.

Sheet 1:
A....K L M
1 Part 1
2 Part 2
3 Part 3 4/16/2009

Sheet 2:
A B
1 Part 3 4/16/2009
2 Part 4
3 Part 5 4/17/2009





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

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