Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 587
Default Vlookup for repitative data

hi,

select range E1:E4
copy this formula in E1

=INDEX(ID,SMALL(IF(Product="Abc",ROW(INDIRECT("1:" &ROWS(Product)))),ROW()))

validate with ctrl + shift + enter

--
isabelle


Le 2011-10-07 09:09, Raju a écrit :

Actually I need a formula
Is there any such formula??

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Vlookup for repitative data

On Oct 7, 9:57*am, isabelle wrote:
hi,

select range E1:E4
copy this formula in E1

=INDEX(ID,SMALL(IF(Product="Abc",ROW(INDIRECT("1:" &ROWS(Product)))),ROW()))

validate with ctrl + shift + enter

--
isabelle

Le 2011-10-07 09:09, Raju a écrit :



Actually I need a formula
Is there any such formula??- Hide quoted text -


- Show quoted text -


Hey isabelle,

Its really nice one!!!
An array formula I had used few of them but in this one I didn't
understand logic for "ROW(INDIRECT("1:"&ROWS(Product))" what its
actually returning to small function when if condition gets true i.e.
Product="Abc" ??
That would be great if you could tell me the logic

When I enterted =INDIRECT("1:"&ROWS(Product)) into different cell say
"D1" for tesing output what it retuns, it shown "product".
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 587
Default Vlookup for repitative data

hi,

I'll try to explain the way I understand

Product ID
Abc 101
Abc 100
Abb 105
Abb 107
Abc 102
Abb 109


=INDEX(ID,SMALL(IF(Product="Abc",ROW(INDIRECT("1:" &ROWS(Product)))),ROW()))

Product="Abc" evaluates each cell in the range and returns TRUE or FALSE as an internal array
True
True
False
False
True
False

ROW(INDIRECT("1:"&ROWS(Product))) returns an array containing the line number

IF(Product="Abc",ROW(INDIRECT("1:"&ROWS(Product)))
then we check each value of internal array "true or false" to return the line number
note that we start at line 1 for the INDEX function

now the internal array is:

2
3
0
0
6
0

SMALL(internal array,ROW())
Return a new internal array :

2
3
6
0
0
0

=INDEX(ID,internal array)
Return:

101
100
102
#NUM!
#NUM!
#NUM!


--
isabelle

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Vlookup for repitative data

On Oct 10, 11:23*am, isabelle wrote:
hi,

I'll try to explain the way I understand

Product ID
Abc 101
Abc 100
Abb 105
Abb 107
Abc 102
Abb 109

* =INDEX(ID,SMALL(IF(Product="Abc",ROW(INDIRECT("1:" &ROWS(Product)))),ROW()))

Product="Abc" evaluates each cell in the range and returns TRUE or FALSE as an internal array
True
True
False
False
True
False

* ROW(INDIRECT("1:"&ROWS(Product))) returns an array containing the line number

* IF(Product="Abc",ROW(INDIRECT("1:"&ROWS(Product)))
then we check each value of internal array "true or false" to return the line number
note that we start at line 1 for the INDEX function

now the internal array is:

2
3
0
0
6
0

SMALL(internal array,ROW())
Return a new internal array :

2
3
6
0
0
0

=INDEX(ID,internal array)
Return:

101
100
102
#NUM!
#NUM!
#NUM!

--
isabelle


Its really cool !!!

it more clear now to me, I think I can use any type of array formula
henceforth
thanks a lot!!!
isabelle
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Vlookup for repitative data

On Oct 7, 9:57*am, isabelle wrote:
hi,

select range E1:E4
copy this formula in E1

=INDEX(ID,SMALL(IF(Product="Abc",ROW(INDIRECT("1:" &ROWS(Product)))),ROW()))

validate with ctrl + shift + enter

--
isabelle

Le 2011-10-07 09:09, Raju a écrit : Actually I need a formula
Is there any such formula??


Hey isabelle,

Its really nice one!!!
An array formula I had used few of them but in this one I didn't
understand logic for "ROW(INDIRECT("1:"&ROWS(Product))" what its
actually returning to small function when if condition gets true i.e.
Product="Abc" ??
That would be great if you could tell me the logic

When I enterted =INDIRECT("1:"&ROWS(Product)) into different cell say
"D1" for tesing output what it retuns, it shown "product".


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
=IF(ISNA(VLOOKUP(A1,Data!$B$1:$C$200,MATCH(A1,Data!$A$1:$C$1,IF($V nv77078 Excel Discussion (Misc queries) 3 January 26th 10 08:38 PM
Data validation and vlookup over 12 tables of data Joe W[_2_] Excel Discussion (Misc queries) 1 September 11th 09 02:49 AM
extracting data from one sheet based on data in another - VLookup? des Excel Worksheet Functions 3 February 4th 09 07:27 PM
Data Validation vs VLOOKUP - Linking to data in a seperate file Sharon Excel Worksheet Functions 3 May 15th 08 07:43 AM
vlookup when data is not all in same row Brad Excel Worksheet Functions 5 January 26th 05 01:38 PM


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