Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Lookup valid combination of multiple cells

Is it possible to lookup a valid match of 2 values in separate columns, and
provide the value of a related third column?

Sheet1

Name Code Amount
Ant 003 100
Bil 002 200
Claire 001 300

Sheet2

Full code Amount
Ant003

The Full code in Sheet2 is entered manually and I wish to keep this.

The Amount cell in Sheet2 should lookup the full code (eg Ant003) directly
from the concatenation of the Name and Code fields in Sheet1 (in this case it
should display 100)

Is it possible to retrieve the amount automatically without having to create
a separate lookup table, as this is the current method and I want to lose
this intermediary step?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Lookup valid combination of multiple cells

Try in the Amount field (B2) on Sheet2:

=SUMPRODUCT(--(Sheet1!$B$2:$B$4=RIGHT(A2,3)),--(Sheet1!$A$2:$A$4=LEFT(A2,LEN(A2)-3)),--(Sheet1!$C$2:$C$4))

This assumes Code is always 3 characters long.

HTH

"Gerard" wrote:

Is it possible to lookup a valid match of 2 values in separate columns, and
provide the value of a related third column?

Sheet1

Name Code Amount
Ant 003 100
Bil 002 200
Claire 001 300

Sheet2

Full code Amount
Ant003

The Full code in Sheet2 is entered manually and I wish to keep this.

The Amount cell in Sheet2 should lookup the full code (eg Ant003) directly
from the concatenation of the Name and Code fields in Sheet1 (in this case it
should display 100)

Is it possible to retrieve the amount automatically without having to create
a separate lookup table, as this is the current method and I want to lose
this intermediary step?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Lookup valid combination of multiple cells

That's worked! Thank you very much.

Just out of interest, if the code was either:

- Always 2 characters long
- Variable

What impact would this have on the function?

Once again, thanks for your help.

Gerard

"Toppers" wrote:

Try in the Amount field (B2) on Sheet2:

=SUMPRODUCT(--(Sheet1!$B$2:$B$4=RIGHT(A2,3)),--(Sheet1!$A$2:$A$4=LEFT(A2,LEN(A2)-3)),--(Sheet1!$C$2:$C$4))

This assumes Code is always 3 characters long.

HTH

"Gerard" wrote:

Is it possible to lookup a valid match of 2 values in separate columns, and
provide the value of a related third column?

Sheet1

Name Code Amount
Ant 003 100
Bil 002 200
Claire 001 300

Sheet2

Full code Amount
Ant003

The Full code in Sheet2 is entered manually and I wish to keep this.

The Amount cell in Sheet2 should lookup the full code (eg Ant003) directly
from the concatenation of the Name and Code fields in Sheet1 (in this case it
should display 100)

Is it possible to retrieve the amount automatically without having to create
a separate lookup table, as this is the current method and I want to lose
this intermediary step?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Lookup valid combination of multiple cells

If 2 characters long:

=SUMPRODUCT(--(Sheet1!$B$2:$B$4=RIGHT(A2,2)),--(Sheet1!$A$2:$A$4=LEFT(A2,LEN(A2)-2)),--(Sheet1!$C$2:$C$4))

If the length is variable, then we would have to test for a numeric string
(the code) and determine its length so it's rather more complicated.


"Gerard" wrote:

That's worked! Thank you very much.

Just out of interest, if the code was either:

- Always 2 characters long
- Variable

What impact would this have on the function?

Once again, thanks for your help.

Gerard

"Toppers" wrote:

Try in the Amount field (B2) on Sheet2:

=SUMPRODUCT(--(Sheet1!$B$2:$B$4=RIGHT(A2,3)),--(Sheet1!$A$2:$A$4=LEFT(A2,LEN(A2)-3)),--(Sheet1!$C$2:$C$4))

This assumes Code is always 3 characters long.

HTH

"Gerard" wrote:

Is it possible to lookup a valid match of 2 values in separate columns, and
provide the value of a related third column?

Sheet1

Name Code Amount
Ant 003 100
Bil 002 200
Claire 001 300

Sheet2

Full code Amount
Ant003

The Full code in Sheet2 is entered manually and I wish to keep this.

The Amount cell in Sheet2 should lookup the full code (eg Ant003) directly
from the concatenation of the Name and Code fields in Sheet1 (in this case it
should display 100)

Is it possible to retrieve the amount automatically without having to create
a separate lookup table, as this is the current method and I want to lose
this intermediary step?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Lookup valid combination of multiple cells

In sheet 2:

=SUMPRODUCT(--(Name&Code=A2),Amount)


"Gerard" wrote:

Is it possible to lookup a valid match of 2 values in separate columns, and
provide the value of a related third column?

Sheet1

Name Code Amount
Ant 003 100
Bil 002 200
Claire 001 300

Sheet2

Full code Amount
Ant003

The Full code in Sheet2 is entered manually and I wish to keep this.

The Amount cell in Sheet2 should lookup the full code (eg Ant003) directly
from the concatenation of the Name and Code fields in Sheet1 (in this case it
should display 100)

Is it possible to retrieve the amount automatically without having to create
a separate lookup table, as this is the current method and I want to lose
this intermediary step?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 19
Default Lookup valid combination of multiple cells

That works perfectly, thanks.

"Teethless mama" wrote:

In sheet 2:

=SUMPRODUCT(--(Name&Code=A2),Amount)


"Gerard" wrote:

Is it possible to lookup a valid match of 2 values in separate columns, and
provide the value of a related third column?

Sheet1

Name Code Amount
Ant 003 100
Bil 002 200
Claire 001 300

Sheet2

Full code Amount
Ant003

The Full code in Sheet2 is entered manually and I wish to keep this.

The Amount cell in Sheet2 should lookup the full code (eg Ant003) directly
from the concatenation of the Name and Code fields in Sheet1 (in this case it
should display 100)

Is it possible to retrieve the amount automatically without having to create
a separate lookup table, as this is the current method and I want to lose
this intermediary step?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
returning multiple cells for a single lookup esloan Excel Discussion (Misc queries) 2 August 22nd 07 06:52 PM
counting valid dates in a range of cells TBA Excel Worksheet Functions 5 June 29th 06 04:39 AM
VLOOKUP - Multiple cells in lookup value RMF Excel Worksheet Functions 1 January 23rd 06 10:28 AM
multiple combination bars chart blurboiboi Charts and Charting in Excel 2 July 19th 05 03:03 AM
How do I Select Multiple entries from Valid list for a Cell WIDBIS Excel Discussion (Misc queries) 1 June 29th 05 12:53 AM


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"