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 a value that fits two (2) criterion

I need to find a value that is identified by 2 criterion. For example, I need
to identify the profit of brand y in store 91 (7.0). A vlookup only considers
one criterion, so I need to crossreference with another.

Store Brand Sales Profit Index
91 x 12.6 6.5 0.9
91 y 11.3 7.0 0.7
91 z 19.4 8.3 1
33 x 11.3 7.1 0.6
33 y 10.0 7.0 0.9
33 z 14.0 7.3 0.8

Thank you for your help
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Lookup a value that fits two (2) criterion

Hi,

Use this ARRAY formula.
=INDEX(D2:D7,MATCH(1,(A2:A7=91)*(B2:B7="y"),0))

In Practice you would be better putting the lookup values in a cell
=INDEX(D2:D7,MATCH(1,(A2:A7=G1)*(B2:B7=G2),0))


This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Carlos R" wrote:

I need to find a value that is identified by 2 criterion. For example, I need
to identify the profit of brand y in store 91 (7.0). A vlookup only considers
one criterion, so I need to crossreference with another.

Store Brand Sales Profit Index
91 x 12.6 6.5 0.9
91 y 11.3 7.0 0.7
91 z 19.4 8.3 1
33 x 11.3 7.1 0.6
33 y 10.0 7.0 0.9
33 z 14.0 7.3 0.8

Thank you for your help

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 66
Default Lookup a value that fits two (2) criterion

Dear Mike,

how if we would like to know....

the first occurance of Brand X, profit = 6.5
then we need the second occurance of Brand X, profit = 7.1

As if we use Vlookup, only get the first profit = 6.5.
On the other hand, we need the second occurance also..

Please guide further.

Respectfully,
andri

"Mike H" wrote:

Hi,

Use this ARRAY formula.
=INDEX(D2:D7,MATCH(1,(A2:A7=91)*(B2:B7="y"),0))

In Practice you would be better putting the lookup values in a cell
=INDEX(D2:D7,MATCH(1,(A2:A7=G1)*(B2:B7=G2),0))


This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Carlos R" wrote:

I need to find a value that is identified by 2 criterion. For example, I need
to identify the profit of brand y in store 91 (7.0). A vlookup only considers
one criterion, so I need to crossreference with another.

Store Brand Sales Profit Index
91 x 12.6 6.5 0.9
91 y 11.3 7.0 0.7
91 z 19.4 8.3 1
33 x 11.3 7.1 0.6
33 y 10.0 7.0 0.9
33 z 14.0 7.3 0.8

Thank you for your help

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default Lookup a value that fits two (2) criterion

Try this formula:

=INDEX(D1:D7,LARGE((B1:B7="x")*ROW(B1:B7),COUNTIF( B1:B7,"x")+1-N))

Note: This is an array formula that should be confirmed with
CTRL+SHIFT+ENTER rather than just ENTER.

Replace N with 1 for the first, 2 for the second, etc occurance of "x"
in column B. The formula will return the corresponding value from the
D column.

Hope this helps / Lars-Åke


On Mon, 8 Feb 2010 04:49:01 -0800, Andri
wrote:

Dear Mike,

how if we would like to know....

the first occurance of Brand X, profit = 6.5
then we need the second occurance of Brand X, profit = 7.1

As if we use Vlookup, only get the first profit = 6.5.
On the other hand, we need the second occurance also..

Please guide further.

Respectfully,
andri

"Mike H" wrote:

Hi,

Use this ARRAY formula.
=INDEX(D2:D7,MATCH(1,(A2:A7=91)*(B2:B7="y"),0))

In Practice you would be better putting the lookup values in a cell
=INDEX(D2:D7,MATCH(1,(A2:A7=G1)*(B2:B7=G2),0))


This is an array formula which must be entered by pressing CTRL+Shift+Enter
'and not just Enter. If you do it correctly then Excel will put curly brackets
'around the formula {}. You can't type these yourself. If you edit the formula
'you must enter it again with CTRL+Shift+Enter.


--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Carlos R" wrote:

I need to find a value that is identified by 2 criterion. For example, I need
to identify the profit of brand y in store 91 (7.0). A vlookup only considers
one criterion, so I need to crossreference with another.

Store Brand Sales Profit Index
91 x 12.6 6.5 0.9
91 y 11.3 7.0 0.7
91 z 19.4 8.3 1
33 x 11.3 7.1 0.6
33 y 10.0 7.0 0.9
33 z 14.0 7.3 0.8

Thank you 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
Movng Data Automatically the Fits a provision [email protected] Excel Worksheet Functions 3 June 20th 07 09:40 PM
How do I list all Data in a column that fits between two points? Jason Excel Discussion (Misc queries) 2 February 22nd 07 04:51 PM
I would like a function to return a value that fits its range rpbsr Excel Worksheet Functions 4 September 7th 06 06:49 PM
nonlinear regression/ curve fits geocalc Excel Discussion (Misc queries) 4 December 30th 05 08:18 PM
Making an alphabetical list that fits on one page. David New Users to Excel 3 October 9th 05 12:03 AM


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