Multi-Cell Lookup Search Results

qlander

New Member
Joined
Dec 26, 2018
Messages
12
Office Version
  1. 2016
Platform
  1. Windows
hi,



I'm having difficulty creating a formula using INDIRECT to cross reference a series of relevant rows (columnA) and searching for specific criteria found in another sheet, and once found outputting each result.



eg: using a csv for the data



Sheet 1 will have the data:



"Reference","Text"

312,"This Is The Text To Search - for AAA"

316,"Some other Text tosearch - for ABA"

319,"Some other text to search for"

312,"other text to search for XXXXXX"

391,"Some - for AaA other text"

312,"this is some - for BDDDFLk data text"

316,"More text other for it search - for AAA"

312,"Text 1 2 3 4 5, for AAA, - for 12345,ro2 extras"

316,"more than other to text"

311,"more other text search"

316," This other has more than text to search for"

312," This - for atestto is for a test but - for including this text"



Sheet 2 will have the extraction:



"Reference","Start Search","End Search","Result 1", "Result 2", "Result 3",.....etc..

312," - for "," ","AAA","BDDDFLk","12345,ro2",atestto","including"

316," other ","search","Text to ","for it ","has more than text to "

....etc..


(Please note: forum italic just used to highlight extraction criteria and bold used to highlight data extracted).


I'm getting stuck on how to approach this - ie multiple VLOOKUP results using Column A matching? and then what?

Needs to be a non-array'd excel formula (due to large size of data), unfortunately not using VB (due to restrictions), etc..



Anyone able to help at all?



Thanks
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
sorry, because you posted your data not in a table structure, i wanst able to recreate exactly a %100 working formula..

but here is a good start:


Excel 2016 (Windows) 32 bit
ABCDEFGHIJK
1ReferenceText
2ReferenceStart SearchEnd SearchResult 1"Result 2""Result 3".....etc..
3312This Is The Text To Search - forAAA316othersearchText tofor it#VALUE!#VALUE!#NUM!
4316SomeotherText tosearch- for ABA
5319Some other text to search for
6312other text to search for XXXXXX
7391Some - for AaA other text
8312this is some- forBDDDFLkdata text
9316More textotherfor itsearch- for AAA
10312Text 1 2 3 4 5, for AAA,- for12345,ro2extras
11316more than other to text
12311more other text search
13316Thisotherhas more than text tosearchfor
14312This- foratesttois for a test but- forincludingthis text
Sheet3
Cell Formulas
RangeFormula
G3{=MID(INDEX($B$3:$B$14,SMALL(IF($A$3:$A$14=$D3,ROW($A$3:$A$14)-ROW($A$3)+1),COLUMNS($G$2:G2))),FIND($E3,INDEX($B$3:$B$14,SMALL(IF($A$3:$A$14=$D3,ROW($A$3:$A$14)-ROW($A$3)+1),COLUMNS($G$2:G2))))+LEN($E3),(FIND($F3,INDEX($B$3:$B$14,SMALL(IF($A$3:$A$14=$D3,ROW($A$3:$A$14)-ROW($A$3)+1),COLUMNS($G$2:G2))),FIND(E3,INDEX($B$3:$B$14,SMALL(IF($A$3:$A$14=$D3,ROW($A$3:$A$14)-ROW($A$3)+1),COLUMNS($G$2:G2))))))-(FIND($E3,INDEX($B$3:$B$14,SMALL(IF($A$3:$A$14=$D3,ROW($A$3:$A$14)-ROW($A$3)+1),COLUMNS($G$2:G2))))+LEN($E3)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Last edited:
Upvote 0
sorry, because you posted your data not in a table structure, i wanst able to recreate exactly a %100 working formula..
...
[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=E0E0F0]#E0E0F0[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=E0E0F0]#E0E0F0[/URL] "]G3[/TH]
[TD="align: left"]{=MID([COLOR=rgb(255]INDEX($B$3:$B$14,SMALL([COLOR=0)]IF([COLOR=rgb(0]$A$3:$A$14=$D3,ROW($A$3:$A$14)-ROW($A$3)+1[/COLOR]),COLUMNS([COLOR=rgb(0]$G$2:G2[/COLOR])[/COLOR])),FIND($E3,INDEX([COLOR=0)]$B$3:$B$14,SMALL([COLOR=rgb(0]IF($A$3:$A$14=$D3,ROW([COLOR=255)]$A$3:$A$14[/COLOR])-ROW([COLOR=255)]$A$3[/COLOR])+1),COLUMNS($G$2:G2)[/COLOR])[/COLOR]))+LEN($E3),(FIND([COLOR=0)]$F3,INDEX([COLOR=rgb(0]$B$3:$B$14,SMALL(IF([COLOR=255)]$A$3:$A$14=$D3,ROW([COLOR=rgb(0]$A$3:$A$14[/COLOR])-ROW([COLOR=rgb(0]$A$3[/COLOR])+1[/COLOR]),COLUMNS([COLOR=255)]$G$2:G2[/COLOR]))[/COLOR]),FIND([COLOR=rgb(0]E3,INDEX($B$3:$B$14,SMALL([COLOR=255)]IF([COLOR=rgb(0]$A$3:$A$14=$D3,ROW([COLOR=rgb(255]$A$3:$A$14[/COLOR])-ROW([COLOR=rgb(255]$A$3[/COLOR])+1[/COLOR]),COLUMNS([COLOR=rgb(0]$G$2:G2[/COLOR])[/COLOR]))[/COLOR])[/COLOR]))-(FIND([COLOR=0)]$E3,INDEX([COLOR=rgb(0]$B$3:$B$14,SMALL(IF([COLOR=255)]$A$3:$A$14=$D3,ROW([COLOR=rgb(0]$A$3:$A$14[/COLOR])-ROW([COLOR=rgb(0]$A$3[/COLOR])+1[/COLOR]),COLUMNS([COLOR=255)]$G$2:G2[/COLOR]))[/COLOR])[/COLOR])+LEN([COLOR=0)]$E3[/COLOR]))[/COLOR])}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]

Wow that was quick! Thanks :)

This formula works well with small data sets. Unfortunately because I'm using big-data (60k+ cells) it lags a lot, thus the use of INDIRECT to avoid arrays (Ctrl+Shift+Enter). I'll see if I can adapt and re-post if possible.
 
Upvote 0
my code doesnt use indirect. Did you mean you wanted a faster formula?

Glad we are on the right track :).
 
Upvote 0
my code doesnt use indirect. Did you mean you wanted a faster formula?

Glad we are on the right track :).

Yes, indirect avoids the use of array formula's since I'm using a large data set, arrays just freeze up the sheet. The formula works well with a small data set otherwise (after correcting some minor typo's). :)
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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