Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default lookup multi values

I need to lookup data within a list and select a value in the appropriate row
based on the values of two inputs(report date and user name, for example),
not just one. The list data is such that I cannot make any modifications to
it (like concatenating the two fields together.
ReportDate User Value
060824 Mary $5
060824 Joe $4
060831 Mary $6
060831 Joe $3
I need to be able to retrieve the value $3 by inputting 060831 and Joe.
Note the list has many rows and about a dozen columns.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default lookup multi values

If you want exact matches for just two columns (and return a value from a
third), you could use:

=index(othersheet!$c$1:$c$100,
match(1,(a2=othersheet!$a$1:$a$100)*(b2=othersheet !$b$1:$b$100),0))

(all in one cell)

Where A2 holds the the value to match in column A and B2 holds the value to
match in column B.

This is an array formula. Hit ctrl-shift-enter instead of enter. If you do it
correctly, excel will wrap curly brackets {} around your formula. (don't type
them yourself.)

Adjust the range to match--but you can't use the whole column.

This returns the value in othersheet column C when column A and B (of
othersheet) match A2 and B2 of the sheet with the formula.

And you can add more conditions by just adding more stuff to that product
portion of the formula:

=index(othersheet!$d$1:$d$100,
match(1,(a2=othersheet!$a$1:$a$100)
*(b2=othersheet!$b$1:$b$100)
*(c2=othersheet!$c$1:$c$100),0))

robtlewis957 wrote:

I need to lookup data within a list and select a value in the appropriate row
based on the values of two inputs(report date and user name, for example),
not just one. The list data is such that I cannot make any modifications to
it (like concatenating the two fields together.
ReportDate User Value
060824 Mary $5
060824 Joe $4
060831 Mary $6
060831 Joe $3
I need to be able to retrieve the value $3 by inputting 060831 and Joe.
Note the list has many rows and about a dozen columns.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,688
Default lookup multi values

Hi!

If there will be only a single instance of 060831 and Joe?

Assuming the report dates are really formatted TEXT entries (leading 0's):

=SUMPRODUCT(--(A2:A5="060831"),--(B2:B5="Joe"),C2:C5)

If there might be multiple instances of 060831 and Joe which one do you
want?

Entered as an array using the key combination of CTRL,SHIFT,ENTER (not just
ENTER):

=INDEX(C2:C5,MATCH(1,(A2:A5="060831")*(B2:B5="Joe" ),0))

Will match the FIRST instance.

Biff

"robtlewis957" wrote in message
...
I need to lookup data within a list and select a value in the appropriate
row
based on the values of two inputs(report date and user name, for example),
not just one. The list data is such that I cannot make any modifications
to
it (like concatenating the two fields together.
ReportDate User Value
060824 Mary $5
060824 Joe $4
060831 Mary $6
060831 Joe $3
I need to be able to retrieve the value $3 by inputting 060831 and Joe.
Note the list has many rows and about a dozen columns.



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
How do I use vlookup with two lookup values? pinpalchris Excel Worksheet Functions 4 April 25th 06 06:57 PM
Advanced Lookup (lookup for 2 values) 0-0 Wai Wai ^-^ Excel Worksheet Functions 2 March 30th 06 07:09 PM
how do I lookup multiple values Lisa Excel Discussion (Misc queries) 2 December 19th 05 08:58 PM
Lookup values in one column to return another [email protected] Excel Worksheet Functions 4 November 17th 05 09:42 PM
how to lookup a value and return multiple corresponding values Asthee Excel Worksheet Functions 1 November 5th 05 01:49 PM


All times are GMT +1. The time now is 08:56 AM.

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

About Us

"It's about Microsoft Excel"