Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default lookup 2 columns, return value from third

I have two tables of pretty much the same format. Column A shows a name that
may or may not be repeated a few times, while column B shows one of four
values (say, 1, 2, 3, 4). I need a formula that will return the result of
the third column, if it matches Column A and Column B.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default lookup 2 columns, return value from third

Saved from a previous post:

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)

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 only use the whole column in xl2007.

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))

slezgus wrote:

I have two tables of pretty much the same format. Column A shows a name that
may or may not be repeated a few times, while column B shows one of four
values (say, 1, 2, 3, 4). I need a formula that will return the result of
the third column, if it matches Column A and Column B.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default lookup 2 columns, return value from third

Something like this in say D1, array-entered*:
=INDEX(C2:C10,MATCH(1,(A2:A10="Name1")*(B2:B10=3), 0))
Press CTRL+SHIFT+ENTER to confirm the formula
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"slezgus" wrote:
I have two tables of pretty much the same format. Column A shows a name that
may or may not be repeated a few times, while column B shows one of four
values (say, 1, 2, 3, 4). I need a formula that will return the result of
the third column, if it matches Column A and Column B.

  #4   Report Post  
Junior Member
 
Posts: 1
Red face

Quote:
Originally Posted by Max View Post
Something like this in say D1, array-entered*:
=INDEX(C2:C10,MATCH(1,(A2:A10="Name1")*(B2:B10=3), 0))
Press CTRL+SHIFT+ENTER to confirm the formula
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"slezgus" wrote:
I have two tables of pretty much the same format. Column A shows a name that
may or may not be repeated a few times, while column B shows one of four
values (say, 1, 2, 3, 4). I need a formula that will return the result of
the third column, if it matches Column A and Column B.


Hi the
Thank you.. this formula works great!

I was wondering how, if at all, I can use the IFNA with the Index+Match formula above.
I tried using it this way but I ended up with a #NA

Quote:
=IFNA(INDEX(ActualHours!C$1:C$200,MATCH(1,($A3=Act ualHours!$A$1:$A$200)*($B3=ActualHours!$B$1:$B$200 ),0)),"")
(ended it with a ctrl +shift + enter)

Thanks for your help...
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
Lookup based on 2 columns; return 1 value MsBeverlee Excel Worksheet Functions 4 December 16th 07 08:20 PM
V lookup with 2 criteria to return results for multiple columns JenL Excel Worksheet Functions 2 September 20th 07 10:04 PM
lookup for a value in multiple columns and return a result Ram Excel Discussion (Misc queries) 16 June 29th 07 11:16 PM
Lookup 3 columns and return a result from another column [email protected] Excel Discussion (Misc queries) 4 February 21st 07 10:54 PM
BIFF - Help!! lookup numbers in multiple columns and return one nu JB Excel Worksheet Functions 6 October 23rd 06 02:56 PM


All times are GMT +1. The time now is 07:18 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"