Vlookup --> find next

Sunvisor

Board Regular
Joined
Oct 9, 2009
Messages
233
Lets say you are using a vlookup to a value but there are multiple values with different results...

Is there a formula to do a vlookup and then in the row underneath say if vlookup = the above result, go to next?
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Dear once again i need help

in vba when in past this formula vba give me error, what is the issue in this formula

Range("F2").FormulaR1C1 = "=REPLACE(RC[-1],2,5,"RSL")"

thanks
 
Upvote 0
Hi,

I have similar kind of scenario, but I could not solve it easily,
My requirement is


Item Value Lookup Count Value
A 23 X 3 34
X 34 89
C 24 82
B 64 A 2 23
X 89 73
X 82
A 73
D 97
C 97

can you please me out in this?
 
Upvote 0
Hi,

I have similar kind of scenario, but I could not solve it easily,
My requirement is


Item Value Lookup Count Value
A 23 X 3 34
X 34 89
C 24 82
B 64 A 2 23
X 89 73
X 82
A 73
D 97
C 97

can you please me out in this?

Row\Col
A​
B​
C​
D​
E​
F​
1​
ItemValueLookup
2​
A
23​
XA
3​
X
34​
Count
4​
C
24​
3​
2​
5​
B
64​
Value
6​
X
89​
34​
23​
7​
X
82​
89​
73​
8​
A
73​
82​
9​
D
97​
10​
C
97​

E4, just enter and copy across to F4:
Rich (BB code):

=COUNTIFS($A$2:$A$10,E$2)

E6, control+shift+enter, not just enter, and copy across to F6, and down:
Rich (BB code):

=IF(ROWS(E$6:E6)<=E$4,INDEX($B$2:$B$10,SMALL(IF($A$2:$A$10=E$2,
    ROW($A$2:$A$10)-ROW($A$2)+1),ROWS(E$6:E6))),"")
 
Upvote 0
See if this is what you had in mind.

Sheet1

*
A
B
C
D
E
F
1
Item
Value
*
Lookup
Count
Value
2
A
23
*
X
3
34
3
X
34
*
*
*
89
4
C
24
*
*
*
82
5
B
64
*
*
*
*
6
X
89
*
*
*
*
7
X
82
*
*
*
*
8
A
73
*
*
*
*
9
D
97
*
*
*
*
10
C
97
*
*
*
*

<tbody>
</tbody>



You want to lookup all instances of X and return the corresponding values.

In the formulas I use the following defined named ranges:
  • Item
  • Refers to: =Sheet1!$A$2:$A$10
  • Value
  • Refers to: =Sheet1!$B:$B
Enter this formula in E2. This will return the count of records for the lookup value.

=COUNTIF(Item,D2)

Enter this array formula** in F2. This will extract the corresponding data for the lookup value.

=IF(ROWS(F$2:F2)>E$2,"",INDEX(Value,SMALL(IF(Item=D$2,ROW(Item)),ROWS(F$2:F2))))

Copy down until you get blanks.

** array formulas need to be entered using the key combination of CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT key then hit ENTER.

I'm not sure if I should continue with this thread or start a new one but I stumbled across this solution and got it to work but would like to tweak it somewhat.
The data I am looking through is addresses and I would like to allow for partial matches. I have changed one of the formulas and it works fine. The issue is the array formula will do partial matches.

I used this to count the partial matches which works fine:
=COUNTIF(Item,"*"&D2&"*")

What would I need to change in the array formula to handle wildcards? Is this even possible?

I have tried this with no luck:
=IF(ROWS(F$2:F2)>E$2,"",INDEX(Value,SMALL(IF(Item="*"&D$2&"*",ROW(Item)),ROWS(F$2:F2))))

Any assistance is greatly appreciated.

Thank you
 
Upvote 0
@Bytor47;4720287]I'm not sure if I should continue with this thread or start a new one but I stumbled across this solution and got it to work but would like to tweak it somewhat.
The data I am looking through is addresses and I would like to allow for partial matches. I have changed one of the formulas and it works fine. The issue is the array formula will do partial matches.

I used this to count the partial matches which works fine:
=COUNTIF(Item,"*"&D2&"*")

What would I need to change in the array formula to handle wildcards? Is this even possible?

I have tried this with no luck:
=IF(ROWS(F$2:F2)>E$2,"",INDEX(Value,SMALL(IF(Item="*"&D$2&"*",ROW(Item)),ROWS(F$2:F2))))

Any assistance is greatly appreciated.

Thank you[/QUOTE]

Control+shift+enter, not just enter, and copy down:

=IF(ROWS(F$2:F2)>E$2,"",INDEX(Value,SMALL(IF(ISNUMBER(SEARCH(D$2,Item)),ROW(Value)-ROW(INDEX(Value,1,1))+1),ROWS(F$2:F2))))

Does this work for you?
 
Upvote 0
@Bytor47;4720287]I'm not sure if I should continue with this thread or start a new one but I stumbled across this solution and got it to work but would like to tweak it somewhat.
The data I am looking through is addresses and I would like to allow for partial matches. I have changed one of the formulas and it works fine. The issue is the array formula will do partial matches.

I used this to count the partial matches which works fine:
=COUNTIF(Item,"*"&D2&"*")

What would I need to change in the array formula to handle wildcards? Is this even possible?

I have tried this with no luck:
=IF(ROWS(F$2:F2)>E$2,"",INDEX(Value,SMALL(IF(Item="*"&D$2&"*",ROW(Item)),ROWS(F$2:F2))))

Any assistance is greatly appreciated.

Thank you

Control+shift+enter, not just enter, and copy down:

=IF(ROWS(F$2:F2)>E$2,"",INDEX(Value,SMALL(IF(ISNUMBER(SEARCH(D$2,Item)),ROW(Value)-ROW(INDEX(Value,1,1))+1),ROWS(F$2:F2))))

Does this work for you?[/QUOTE]

Absolutely! It worked perfectly. Thank you so much.
 
Upvote 0
Control+shift+enter, not just enter, and copy down:

=IF(ROWS(F$2:F2)>E$2,"",INDEX(Value,SMALL(IF(ISNUMBER(SEARCH(D$2,Item)),ROW(Value)-ROW(INDEX(Value,1,1))+1),ROWS(F$2:F2))))

Does this work for you?

Absolutely! It worked perfectly. Thank you so much.[/QUOTE]

You are welcome.
 
Upvote 0

Forum statistics

Threads
1,216,129
Messages
6,129,055
Members
449,484
Latest member
khairianr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top